Fixed code and UML-diagram

generic-observer
SirTeruki 7 years ago
parent 759c43969e
commit 168df83a60

@ -2,6 +2,8 @@ package _3._1;
public class BankUser {
private String name;
private HomeAddress homeAddress;
private WorkAddress workAddress;
public String getName() {
return name;
@ -10,4 +12,20 @@ public class BankUser {
public void setName(String name) {
this.name = name;
}
public HomeAddress getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(HomeAddress homeAddress) {
this.homeAddress = homeAddress;
}
public WorkAddress getWorkAddress() {
return workAddress;
}
public void setWorkAddress(WorkAddress workAddress) {
this.workAddress = workAddress;
}
}

@ -11,12 +11,12 @@ public class Banking {
thorin.setAccounts(new Account[1]);
thorin.getAccounts()[0] = sbt.getAccounts()[0];
thorin.setName("Thorin");
Address home = new Address();
HomeAddress home = new HomeAddress();
home.setStreet("Kingsroad 1");
home.setPostCode("12345");
home.setCity("Dunland");
thorin.setHomeAddress(home);
Address work = new Address();
WorkAddress work = new WorkAddress("Evil Corp");
work.setStreet("Throneroom 1");
work.setPostCode("54321");
work.setCity("Erebor");

@ -1,19 +1,10 @@
package _3._1;
public class Customer extends BankUser{
public class Customer extends BankUser {
private String name;
private Account[] accounts;
private Address homeAddress;
private Address workAddress;
public String getName() {
return name;
}
private Account[] accounts;
public void setName(String name) {
this.name = name;
}
public Account[] getAccounts() {
return accounts;
@ -23,20 +14,5 @@ public class Customer extends BankUser{
this.accounts = accounts;
}
public Address getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(Address homeAddress) {
this.homeAddress = homeAddress;
}
public Address getWorkAddress() {
return workAddress;
}
public void setWorkAddress(Address workAddress) {
this.workAddress = workAddress;
}
}

@ -1,5 +1,14 @@
package _3._1;
public class HomeAddress {
public class HomeAddress extends Address {
private PostOfficeBox postOfficeBox;
public PostOfficeBox getPostOfficeBox() {
return postOfficeBox;
}
public void setPostOfficeBox(PostOfficeBox postOfficeBox) {
this.postOfficeBox = postOfficeBox;
}
}

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?><diagram program="umlet" version="13.3">
<zoom_level>10</zoom_level>
<zoom_level>7</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>460</x>
<y>250</y>
<w>210</w>
<h>200</h>
<x>637</x>
<y>175</y>
<w>147</w>
<h>140</h>
</coordinates>
<panel_attributes>*Customer*
<panel_attributes>*BankUser*
--
- name: String
</panel_attributes>
<additional_attributes/>
@ -18,10 +18,10 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>460</x>
<x>637</x>
<y>0</y>
<w>210</w>
<h>90</h>
<w>147</w>
<h>63</h>
</coordinates>
<panel_attributes>*Account*
--
@ -34,10 +34,10 @@ Account(iban: String)</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>0</x>
<y>250</y>
<w>210</w>
<h>180</h>
<x>119</x>
<y>147</y>
<w>147</w>
<h>126</h>
</coordinates>
<panel_attributes>*Adress*
--
@ -49,10 +49,10 @@ Account(iban: String)</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>10</x>
<x>322</x>
<y>0</y>
<w>210</w>
<h>70</h>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*Bank*
--
@ -64,51 +64,51 @@ Account(iban: String)</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>560</x>
<y>80</y>
<w>100</w>
<h>190</h>
<x>777</x>
<y>28</y>
<w>231</w>
<h>175</h>
</coordinates>
<panel_attributes>lt=&lt;-&gt;
r2=-holders
m2=1..*
r1=-accounts
m1=0..*</panel_attributes>
<additional_attributes>10.0;10.0;10.0;170.0</additional_attributes>
<additional_attributes>10.0;20.0;260.0;20.0;260.0;230.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>250</y>
<w>280</w>
<h>50</h>
<x>497</x>
<y>175</y>
<w>154</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;-
r1=-homeAddress
m1=1</panel_attributes>
<additional_attributes>260.0;20.0;10.0;20.0</additional_attributes>
<panel_attributes>lt=-&gt;
r2=-workAddress
m2=0..1</panel_attributes>
<additional_attributes>200.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>350</y>
<w>280</w>
<h>50</h>
<x>497</x>
<y>245</y>
<w>154</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;-
m1=-workAddress
r1=1</panel_attributes>
<additional_attributes>260.0;20.0;10.0;20.0</additional_attributes>
<panel_attributes>lt=-&gt;
r2=-homeAddress
m2=0..1</panel_attributes>
<additional_attributes>200.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>0</x>
<y>530</y>
<w>210</w>
<h>70</h>
<x>357</x>
<y>154</y>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*WorkAdress*
--
@ -118,45 +118,23 @@ r1=1</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>270</x>
<y>480</y>
<w>210</w>
<h>70</h>
<x>357</x>
<y>224</y>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*HomeAddress*
--
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>40</x>
<y>420</y>
<w>30</w>
<h>130</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;110.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>160</x>
<y>420</y>
<w>170</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;150.0;60.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>270</x>
<y>650</y>
<w>210</w>
<h>70</h>
<x>357</x>
<y>343</y>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*PostOfficeBox*
--
@ -167,10 +145,10 @@ r1=1</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>310</x>
<y>540</y>
<w>130</w>
<h>130</h>
<x>385</x>
<y>266</y>
<w>91</w>
<h>91</h>
</coordinates>
<panel_attributes>lt=&lt;-
r1=-postOfficeBox
@ -180,49 +158,49 @@ m1=0..1</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>520</x>
<y>570</y>
<w>210</w>
<h>70</h>
<x>679</x>
<y>399</y>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*FinancialAdvisor*
--
- customer: Customer[]</panel_attributes>
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>560</x>
<y>440</y>
<w>110</w>
<h>150</h>
<x>707</x>
<y>308</y>
<w>21</w>
<h>105</h>
</coordinates>
<panel_attributes>lt=&lt;-
r1=-customers
m1=0..*</panel_attributes>
<panel_attributes>lt=&lt;&lt;-
</panel_attributes>
<additional_attributes>10.0;10.0;10.0;130.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>800</x>
<y>270</y>
<w>210</w>
<h>70</h>
<x>875</x>
<y>189</y>
<w>147</w>
<h>49</h>
</coordinates>
<panel_attributes>*BankUser*
<panel_attributes>*Customer*
--
- name: String</panel_attributes>
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>660</x>
<y>290</y>
<w>160</w>
<h>30</h>
<x>777</x>
<y>203</y>
<w>112</w>
<h>21</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>140.0;10.0;10.0;10.0</additional_attributes>
@ -230,25 +208,49 @@ m1=0..*</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>720</x>
<y>330</y>
<w>130</w>
<h>300</h>
<x>819</x>
<y>231</y>
<w>203</w>
<h>210</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>110.0;10.0;10.0;280.0</additional_attributes>
<panel_attributes>lt=&lt;-
r1=-customers
m1=0..*</panel_attributes>
<additional_attributes>190.0;10.0;190.0;280.0;10.0;280.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>210</x>
<y>20</y>
<w>270</w>
<h>50</h>
<x>462</x>
<y>14</y>
<w>189</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;&lt;&lt;-&gt;
r2=-accounts
m2=0..*</panel_attributes>
<additional_attributes>10.0;20.0;250.0;20.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>259</x>
<y>175</y>
<w>112</w>
<h>21</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;140.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>259</x>
<y>245</y>
<w>112</w>
<h>21</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;140.0;10.0</additional_attributes>
</element>
</diagram>

Loading…
Cancel
Save