Skip to content

Commit b497d41

Browse files
dRadestiluwatar
authored andcommitted
Modify Observer pattern UML (iluwatar#877)
1 parent aaabc8f commit b497d41

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

observer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Define a one-to-many dependency between objects so that when one
1919
object changes state, all its dependents are notified and updated
2020
automatically.
2121

22-
![alt text](./etc/observer_1.png "Observer")
22+
![alt text](./etc/observer.png "Observer")
2323

2424
## Applicability
2525
Use the Observer pattern in any of the following situations

observer/etc/observer.png

-1.33 KB
Loading

observer/etc/observer.ucls

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<class-diagram version="1.1.8" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
3-
realizations="true" associations="true" dependencies="false" nesting-relationships="true">
2+
<class-diagram version="1.2.3" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
3+
realizations="true" associations="true" dependencies="false" nesting-relationships="true" router="FAN">
44
<class id="1" language="java" name="com.iluwatar.observer.Hobbits" project="observer"
55
file="/observer/src/main/java/com/iluwatar/observer/Hobbits.java" binary="false" corner="BOTTOM_RIGHT">
6-
<position height="106" width="175" x="193" y="288"/>
6+
<position height="-1" width="-1" x="723" y="333"/>
77
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
88
sort-features="false" accessors="true" visibility="true">
99
<attributes public="true" package="true" protected="true" private="true" static="true"/>
@@ -12,7 +12,7 @@
1212
</class>
1313
<interface id="2" language="java" name="com.iluwatar.observer.WeatherObserver" project="observer"
1414
file="/observer/src/main/java/com/iluwatar/observer/WeatherObserver.java" binary="false" corner="BOTTOM_RIGHT">
15-
<position height="88" width="175" x="408" y="488"/>
15+
<position height="-1" width="-1" x="454" y="330"/>
1616
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
1717
sort-features="false" accessors="true" visibility="true">
1818
<attributes public="true" package="true" protected="true" private="true" static="true"/>
@@ -21,7 +21,7 @@
2121
</interface>
2222
<class id="3" language="java" name="com.iluwatar.observer.Orcs" project="observer"
2323
file="/observer/src/main/java/com/iluwatar/observer/Orcs.java" binary="false" corner="BOTTOM_RIGHT">
24-
<position height="106" width="175" x="408" y="288"/>
24+
<position height="-1" width="-1" x="454" y="468"/>
2525
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
2626
sort-features="false" accessors="true" visibility="true">
2727
<attributes public="true" package="true" protected="true" private="true" static="true"/>
@@ -30,7 +30,7 @@
3030
</class>
3131
<class id="4" language="java" name="com.iluwatar.observer.Weather" project="observer"
3232
file="/observer/src/main/java/com/iluwatar/observer/Weather.java" binary="false" corner="BOTTOM_RIGHT">
33-
<position height="160" width="252" x="623" y="288"/>
33+
<position height="-1" width="-1" x="454" y="129"/>
3434
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
3535
sort-features="false" accessors="true" visibility="true">
3636
<attributes public="true" package="true" protected="true" private="true" static="true"/>
@@ -39,7 +39,7 @@
3939
</class>
4040
<enumeration id="5" language="java" name="com.iluwatar.observer.WeatherType" project="observer"
4141
file="/observer/src/main/java/com/iluwatar/observer/WeatherType.java" binary="false" corner="BOTTOM_RIGHT">
42-
<position height="178" width="154" x="623" y="488"/>
42+
<position height="-1" width="-1" x="791" y="129"/>
4343
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
4444
sort-features="false" accessors="true" visibility="true">
4545
<attributes public="true" package="true" protected="true" private="true" static="true"/>
@@ -48,28 +48,36 @@
4848
</enumeration>
4949
<association id="6">
5050
<end type="SOURCE" refId="4" navigable="false">
51-
<attribute id="7" name="observers"/>
52-
<multiplicity id="8" minimum="0" maximum="2147483647"/>
51+
<attribute id="7" name="observers">
52+
<position height="0" width="0" x="-41" y="-202"/>
53+
</attribute>
54+
<multiplicity id="8" minimum="0" maximum="2147483647">
55+
<position height="0" width="0" x="-41" y="-202"/>
56+
</multiplicity>
5357
</end>
5458
<end type="TARGET" refId="2" navigable="true"/>
5559
<display labels="true" multiplicity="true"/>
5660
</association>
5761
<realization id="9">
62+
<end type="SOURCE" refId="3"/>
63+
<end type="TARGET" refId="2"/>
64+
</realization>
65+
<realization id="10">
5866
<end type="SOURCE" refId="1"/>
5967
<end type="TARGET" refId="2"/>
6068
</realization>
61-
<association id="10">
69+
<association id="11">
6270
<end type="SOURCE" refId="4" navigable="false">
63-
<attribute id="11" name="currentWeather"/>
64-
<multiplicity id="12" minimum="0" maximum="1"/>
71+
<attribute id="12" name="currentWeather">
72+
<position height="0" width="0" x="91" y="-448"/>
73+
</attribute>
74+
<multiplicity id="13" minimum="1" maximum="1">
75+
<position height="0" width="0" x="91" y="-448"/>
76+
</multiplicity>
6577
</end>
6678
<end type="TARGET" refId="5" navigable="true"/>
6779
<display labels="true" multiplicity="true"/>
6880
</association>
69-
<realization id="13">
70-
<end type="SOURCE" refId="3"/>
71-
<end type="TARGET" refId="2"/>
72-
</realization>
7381
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
7482
sort-features="false" accessors="true" visibility="true">
7583
<attributes public="true" package="true" protected="true" private="true" static="true"/>

0 commit comments

Comments
 (0)