Skip to content

Commit 16220cd

Browse files
committed
Merge pull request iluwatar#24 from sideris/master
Changed UML diagrams from GenMyModel to ObjectAid
2 parents df721d1 + bc38623 commit 16220cd

File tree

7 files changed

+80
-898
lines changed

7 files changed

+80
-898
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
##Servant
289289
**Intent:** Servant is used for providing some behavior to a group of classes. Instead of defining that behavior in each class - or when we cannot factor out this behavior in the common parent class - it is defined once in the Servant.
290290

291-
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/servant/etc/servant.jpg "Servant")
291+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/servant/etc/servant-pattern.png "Servant")
292292

293293
**Applicability:** Use the Servant pattern when
294294
* When we want some objects to perform a common action and don't want to define this action as a method in every class.

servant/etc/servant-pattern.jpg

59.6 KB
Loading

servant/etc/servant-pattern.png

29.4 KB
Loading

servant/etc/servant-pattern.ucls

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<class-diagram version="1.1.7" icons="true" automaticImage="JPEG" always-add-relationships="false"
3+
generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true">
4+
<class id="1" language="java" name="App" project="servant" file="/servant/src/App.java" binary="false"
5+
corner="BOTTOM_RIGHT">
6+
<position height="-1" width="-1" x="228" y="149"/>
7+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
8+
sort-features="false" accessors="true" visibility="true">
9+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
10+
<operations public="true" package="true" protected="true" private="true" static="true"/>
11+
</display>
12+
</class>
13+
<class id="2" language="java" name="King" project="servant" file="/servant/src/King.java" binary="false"
14+
corner="BOTTOM_RIGHT">
15+
<position height="-1" width="-1" x="522" y="673"/>
16+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
17+
sort-features="false" accessors="true" visibility="true">
18+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
19+
<operations public="true" package="true" protected="true" private="true" static="true"/>
20+
</display>
21+
</class>
22+
<class id="3" language="java" name="Queen" project="servant" file="/servant/src/Queen.java" binary="false"
23+
corner="BOTTOM_RIGHT">
24+
<position height="-1" width="-1" x="729" y="691"/>
25+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
26+
sort-features="false" accessors="true" visibility="true">
27+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
28+
<operations public="true" package="true" protected="true" private="true" static="true"/>
29+
</display>
30+
</class>
31+
<interface id="4" language="java" name="Royalty" project="servant" file="/servant/src/Royalty.java" binary="false"
32+
corner="BOTTOM_RIGHT">
33+
<position height="-1" width="-1" x="579" y="378"/>
34+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
35+
sort-features="false" accessors="true" visibility="true">
36+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
37+
<operations public="true" package="true" protected="true" private="true" static="true"/>
38+
</display>
39+
</interface>
40+
<class id="5" language="java" name="Servant" project="servant" file="/servant/src/Servant.java" binary="false"
41+
corner="BOTTOM_RIGHT">
42+
<position height="-1" width="-1" x="577" y="151"/>
43+
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
44+
sort-features="false" accessors="true" visibility="true">
45+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
46+
<operations public="true" package="true" protected="true" private="true" static="true"/>
47+
</display>
48+
</class>
49+
<realization id="6">
50+
<end type="SOURCE" refId="2"/>
51+
<end type="TARGET" refId="4"/>
52+
</realization>
53+
<dependency id="7">
54+
<end type="SOURCE" refId="5"/>
55+
<end type="TARGET" refId="4"/>
56+
</dependency>
57+
<realization id="8">
58+
<end type="SOURCE" refId="3"/>
59+
<end type="TARGET" refId="4"/>
60+
</realization>
61+
<dependency id="9">
62+
<end type="SOURCE" refId="1"/>
63+
<end type="TARGET" refId="4"/>
64+
</dependency>
65+
<association id="10">
66+
<end type="SOURCE" refId="1" navigable="false">
67+
<attribute id="11" name="jenkins"/>
68+
<multiplicity id="12" minimum="0" maximum="1"/>
69+
</end>
70+
<end type="TARGET" refId="5" navigable="true"/>
71+
<display labels="false" multiplicity="false"/>
72+
</association>
73+
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
74+
sort-features="false" accessors="true" visibility="true">
75+
<attributes public="true" package="true" protected="true" private="true" static="true"/>
76+
<operations public="true" package="true" protected="true" private="true" static="true"/>
77+
</classifier-display>
78+
<association-display labels="true" multiplicity="true"/>
79+
</class-diagram>

servant/etc/servant.jpg

-132 KB
Binary file not shown.

0 commit comments

Comments
 (0)