Browse Source

inicio

s00.badcoupled
Juanjo Pedraza 2 years ago
commit
94d6627a3e
18 changed files with 313 additions and 0 deletions
  1. +26
    -0
      .classpath
  2. +8
    -0
      .idea/.gitignore
  3. +6
    -0
      .idea/misc.xml
  4. +6
    -0
      .idea/vcs.xml
  5. +23
    -0
      .project
  6. +4
    -0
      .settings/org.eclipse.core.resources.prefs
  7. +5
    -0
      .settings/org.eclipse.jdt.core.prefs
  8. +4
    -0
      .settings/org.eclipse.m2e.core.prefs
  9. BIN
      Untitled.gif
  10. +25
    -0
      pom.xml
  11. BIN
      s00.badcoupledsample.jpg.jpg
  12. +55
    -0
      s00.badcoupledsample.jpg.ucls
  13. BIN
      s00.badcoupledsample.png
  14. +59
    -0
      s00.badcoupledsample.ucls
  15. +9
    -0
      src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java
  16. +24
    -0
      src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java
  17. +21
    -0
      src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java
  18. +38
    -0
      src/test/java/es/anaya/spring/badcode/s00/badcoupledsample/AppTest.java

+ 26
- 0
.classpath View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

+ 8
- 0
.idea/.gitignore View File

@ -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

+ 6
- 0
.idea/misc.xml View File

@ -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>

+ 6
- 0
.idea/vcs.xml View File

@ -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>

+ 23
- 0
.project View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>s00.badcoupledsample</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

+ 4
- 0
.settings/org.eclipse.core.resources.prefs View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

+ 5
- 0
.settings/org.eclipse.jdt.core.prefs View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

+ 4
- 0
.settings/org.eclipse.m2e.core.prefs View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

BIN
Untitled.gif View File

Before After
Width: 643  |  Height: 93  |  Size: 3.5 KiB

+ 25
- 0
pom.xml View File

@ -0,0 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>es.anaya.spring.badcode</groupId>
<artifactId>s00.badcoupled</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>s00.badcoupled</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

BIN
s00.badcoupledsample.jpg.jpg View File

Before After
Width: 643  |  Height: 93  |  Size: 16 KiB

+ 55
- 0
s00.badcoupledsample.jpg.ucls View File

@ -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>

BIN
s00.badcoupledsample.png View File

Before After
Width: 625  |  Height: 93  |  Size: 8.9 KiB

+ 59
- 0
s00.badcoupledsample.ucls View File

@ -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>

+ 9
- 0
src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java View File

@ -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());
}
}

+ 24
- 0
src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java View File

@ -0,0 +1,24 @@
package es.anaya.spring.badcode.s00.badcoupled;
import java.util.ArrayList;
public class CsvFileDataSource {
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;
}
}

+ 21
- 0
src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java View File

@ -0,0 +1,21 @@
package es.anaya.spring.badcode.s00.badcoupled;
import java.util.ArrayList;
public class CustomerList {
private CsvFileDataSource csvFileDataSource;
private ArrayList<String> customerData;
public CustomerList () {
this.customerData = new ArrayList<String>();
}
public void loadFile (String filename, String separator) {
csvFileDataSource = new CsvFileDataSource(filename, separator);
customerData = csvFileDataSource.loadData();
}
public String showAll () {
return customerData.toString();
}
}

+ 38
- 0
src/test/java/es/anaya/spring/badcode/s00/badcoupledsample/AppTest.java View File

@ -0,0 +1,38 @@
package es.anaya.spring.badcode.s00.badcoupledsample;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

Loading…
Cancel
Save