| @ -0,0 +1,8 @@ | |||
| # Default ignored files | |||
| /shelf/ | |||
| /workspace.xml | |||
| # Editor-based HTTP Client requests | |||
| /httpRequests/ | |||
| # Datasource local storage ignored files | |||
| /dataSources/ | |||
| /dataSources.local.xml | |||
| @ -0,0 +1,6 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project version="4"> | |||
| <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK"> | |||
| <output url="file://$PROJECT_DIR$/classes" /> | |||
| </component> | |||
| </project> | |||
| @ -0,0 +1,6 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project version="4"> | |||
| <component name="VcsDirectoryMappings"> | |||
| <mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||
| </component> | |||
| </project> | |||
| @ -0,0 +1,55 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <class-diagram version="1.2.2" icons="false" automaticImage="JPEG" always-add-relationships="true" | |||
| generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true" | |||
| router="FAN"> | |||
| <class id="1" language="java" name="es.anaya.spring.badcode.s00.badcoupled.App" project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java" binary="false" | |||
| corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="208" y="296"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <class id="2" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CsvFileDataSource" | |||
| project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="704" y="296"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <class id="3" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CustomerList" | |||
| project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java" binary="false" | |||
| corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="396" y="296"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <association id="4"> | |||
| <end type="SOURCE" refId="3" navigable="false"> | |||
| <attribute id="5" name="csvFileDataSource"/> | |||
| <multiplicity id="6" minimum="0" maximum="1"/> | |||
| </end> | |||
| <end type="TARGET" refId="2" navigable="true"/> | |||
| <display labels="true" multiplicity="true"/> | |||
| </association> | |||
| <dependency id="7"> | |||
| <end type="SOURCE" refId="1"/> | |||
| <end type="TARGET" refId="3"/> | |||
| </dependency> | |||
| <classifier-display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </classifier-display> | |||
| <association-display labels="true" multiplicity="true"/> | |||
| </class-diagram> | |||
| @ -0,0 +1,59 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <class-diagram version="1.2.2" icons="false" automaticImage="PNG" always-add-relationships="false" | |||
| generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true" | |||
| router="FAN"> | |||
| <class id="1" language="java" name="es.anaya.spring.badcode.s00.badcoupled.App" project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java" binary="false" | |||
| corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="119" y="165"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <class id="2" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CsvFileDataSource" | |||
| project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="597" y="165"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <class id="3" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CustomerList" | |||
| project="s00.badcoupledsample" | |||
| file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java" binary="false" | |||
| corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="301" y="165"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <dependency id="4"> | |||
| <end type="SOURCE" refId="1"/> | |||
| <end type="TARGET" refId="3"/> | |||
| </dependency> | |||
| <association id="5"> | |||
| <end type="SOURCE" refId="3" navigable="false"> | |||
| <attribute id="6" name="csvFileDataSource"> | |||
| <position height="0" width="0" x="-21" y="4"/> | |||
| </attribute> | |||
| <multiplicity id="7" minimum="0" maximum="1"> | |||
| <position height="0" width="0" x="-21" y="4"/> | |||
| </multiplicity> | |||
| </end> | |||
| <end type="TARGET" refId="2" navigable="true"/> | |||
| <display labels="true" multiplicity="true"/> | |||
| </association> | |||
| <classifier-display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </classifier-display> | |||
| <association-display labels="true" multiplicity="true"/> | |||
| </class-diagram> | |||
| @ -1,79 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <class-diagram version="1.2.2" icons="false" automaticImage="PNG" always-add-relationships="false" | |||
| generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true" | |||
| router="FAN"> | |||
| <class id="1" language="java" name="es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces.CustomerList" | |||
| project="s00.badcoupledsamplefixed" | |||
| file="/s00.badcoupledsamplefixed/src/main/java/es/anaya/spring/badcode/s00/badcoupledsamplefixedwithinterfaces/CustomerList.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="150" y="131"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <interface id="2" language="java" name="es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces.DataSource" | |||
| project="s00.badcoupledsamplefixed" | |||
| file="/s00.badcoupledsamplefixed/src/main/java/es/anaya/spring/badcode/s00/badcoupledsamplefixedwithinterfaces/DataSource.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="345" y="238"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </interface> | |||
| <class id="3" language="java" name="es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces.CsvFileDataSource" | |||
| project="s00.badcoupledsamplefixed" | |||
| file="/s00.badcoupledsamplefixed/src/main/java/es/anaya/spring/badcode/s00/badcoupledsamplefixedwithinterfaces/CsvFileDataSource.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="538" y="131"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <class id="4" language="java" name="es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces.App" | |||
| project="s00.badcoupledsamplefixed" | |||
| file="/s00.badcoupledsamplefixed/src/main/java/es/anaya/spring/badcode/s00/badcoupledsamplefixedwithinterfaces/App.java" | |||
| binary="false" corner="BOTTOM_RIGHT"> | |||
| <position height="-1" width="-1" x="345" y="131"/> | |||
| <display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </display> | |||
| </class> | |||
| <dependency id="5"> | |||
| <end type="SOURCE" refId="4"/> | |||
| <end type="TARGET" refId="3"/> | |||
| </dependency> | |||
| <dependency id="6"> | |||
| <end type="SOURCE" refId="4"/> | |||
| <end type="TARGET" refId="1"/> | |||
| </dependency> | |||
| <association id="7"> | |||
| <end type="SOURCE" refId="1" navigable="false"> | |||
| <attribute id="8" name="dataSource"/> | |||
| <multiplicity id="9" minimum="0" maximum="1"/> | |||
| </end> | |||
| <end type="TARGET" refId="2" navigable="true"/> | |||
| <display labels="true" multiplicity="true"/> | |||
| </association> | |||
| <realization id="10"> | |||
| <end type="SOURCE" refId="3"/> | |||
| <end type="TARGET" refId="2"/> | |||
| </realization> | |||
| <dependency id="11"> | |||
| <end type="SOURCE" refId="4"/> | |||
| <end type="TARGET" refId="2"/> | |||
| </dependency> | |||
| <classifier-display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
| sort-features="false" accessors="false" visibility="true"> | |||
| <attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
| <operations public="true" package="true" protected="true" private="true" static="true"/> | |||
| </classifier-display> | |||
| <association-display labels="true" multiplicity="true"/> | |||
| </class-diagram> | |||
| @ -0,0 +1,9 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupled; | |||
| public class App { | |||
| public static void main(String[] args) { | |||
| CustomerList customerList = new CustomerList(); | |||
| customerList.loadFile("samplefile.csv", ";"); | |||
| System.out.println(customerList.showAll()); | |||
| } | |||
| } | |||
| @ -1,4 +1,4 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixed; | |||
| package es.anaya.spring.badcode.s00.badcoupled; | |||
| import java.util.ArrayList; | |||
| @ -1,10 +0,0 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixed; | |||
| public class App { | |||
| public static void main(String[] args) { | |||
| CsvFileDataSource csvFileDataSource = new CsvFileDataSource("file.csv", ";"); | |||
| CustomerList customerList = new CustomerList(csvFileDataSource); | |||
| customerList.loadFile("samplefile.csv", ";"); | |||
| System.out.println(customerList.showAll()); | |||
| } | |||
| } | |||
| @ -1,10 +0,0 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces; | |||
| public class App { | |||
| public static void main(String[] args) { | |||
| DataSource csvFileDataSource = new CsvFileDataSource("file.csv", ";"); | |||
| CustomerList customerList = new CustomerList(csvFileDataSource); | |||
| customerList.loadFile("samplefile.csv", ";"); | |||
| System.out.println(customerList.showAll()); | |||
| } | |||
| } | |||
| @ -1,24 +0,0 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces; | |||
| import java.util.ArrayList; | |||
| public class CsvFileDataSource implements DataSource { | |||
| private String filename; | |||
| private String separator; | |||
| public CsvFileDataSource(String filename, String separator) { | |||
| this.filename = filename; | |||
| this.separator = separator; | |||
| } | |||
| public ArrayList<String> loadData() { | |||
| ArrayList<String> lines = new ArrayList<String>(); | |||
| lines.add("Customer1, [email protected], 234 street"); | |||
| lines.add("Customer2, [email protected], 523 street"); | |||
| lines.add("Customer3, [email protected], 231 street"); | |||
| return lines; | |||
| } | |||
| } | |||
| @ -1,21 +0,0 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces; | |||
| import java.util.ArrayList; | |||
| public class CustomerList { | |||
| private DataSource dataSource; | |||
| private ArrayList<String> customerData; | |||
| public CustomerList (DataSource dataSource) { | |||
| this.customerData = new ArrayList<String>(); | |||
| this.dataSource = dataSource; | |||
| } | |||
| public void loadFile (String filename, String separator) { | |||
| customerData = dataSource.loadData(); | |||
| } | |||
| public String showAll () { | |||
| return customerData.toString(); | |||
| } | |||
| } | |||
| @ -1,7 +0,0 @@ | |||
| package es.anaya.spring.badcode.s00.badcoupledsamplefixedwithinterfaces; | |||
| import java.util.ArrayList; | |||
| public interface DataSource { | |||
| public ArrayList<String> loadData(); | |||
| } | |||