#590 Add explanation for Composite pattern
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 16 KiB | 
| @@ -1,75 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <class-diagram version="1.1.8" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"  | ||||
|   realizations="true" associations="true" dependencies="false" nesting-relationships="true">   | ||||
|   <class id="1" language="java" name="com.iluwatar.composite.Messenger" project="composite"  | ||||
|     file="/composite/src/main/java/com/iluwatar/composite/Messenger.java" binary="false" corner="BOTTOM_RIGHT">     | ||||
|     <position height="124" width="247" x="118" y="180"/>     | ||||
|     <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|       sort-features="false" accessors="true" 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="com.iluwatar.composite.Sentence" project="composite"  | ||||
|     file="/composite/src/main/java/com/iluwatar/composite/Sentence.java" binary="false" corner="BOTTOM_RIGHT">     | ||||
|     <position height="124" width="157" x="118" y="407"/>     | ||||
|     <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|       sort-features="false" accessors="true" 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="com.iluwatar.composite.LetterComposite" project="composite"  | ||||
|     file="/composite/src/main/java/com/iluwatar/composite/LetterComposite.java" binary="false" corner="BOTTOM_RIGHT">     | ||||
|     <position height="177" width="176" x="405" y="180"/>     | ||||
|     <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|       sort-features="false" accessors="true" 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="com.iluwatar.composite.Letter" project="composite"  | ||||
|     file="/composite/src/main/java/com/iluwatar/composite/Letter.java" binary="false" corner="BOTTOM_RIGHT">     | ||||
|     <position height="142" width="146" x="315" y="407"/>     | ||||
|     <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|       sort-features="false" accessors="true" 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="5" language="java" name="com.iluwatar.composite.Word" project="composite"  | ||||
|     file="/composite/src/main/java/com/iluwatar/composite/Word.java" binary="false" corner="BOTTOM_RIGHT">     | ||||
|     <position height="124" width="146" x="501" y="407"/>     | ||||
|     <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|       sort-features="false" accessors="true" 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>   | ||||
|   <generalization id="6">     | ||||
|     <end type="SOURCE" refId="2"/>     | ||||
|     <end type="TARGET" refId="3"/>   | ||||
|   </generalization>   | ||||
|   <generalization id="7">     | ||||
|     <end type="SOURCE" refId="4"/>     | ||||
|     <end type="TARGET" refId="3"/>   | ||||
|   </generalization>   | ||||
|   <association id="8">     | ||||
|     <end type="SOURCE" refId="3" navigable="false">       | ||||
|       <attribute id="9" name="children"/>       | ||||
|       <multiplicity id="10" minimum="0" maximum="2147483647"/>     | ||||
|     </end>     | ||||
|     <end type="TARGET" refId="3" navigable="true"/>     | ||||
|     <display labels="true" multiplicity="true"/>   | ||||
|   </association>   | ||||
|   <generalization id="11">     | ||||
|     <end type="SOURCE" refId="5"/>     | ||||
|     <end type="TARGET" refId="3"/>   | ||||
|   </generalization>   | ||||
|   <classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"  | ||||
|     sort-features="false" accessors="true" 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,43 +0,0 @@ | ||||
| @startuml | ||||
| package com.iluwatar.composite { | ||||
|   class App { | ||||
|     - LOGGER : Logger {static} | ||||
|     + App() | ||||
|     + main(args : String[]) {static} | ||||
|   } | ||||
|   class Letter { | ||||
|     - c : char | ||||
|     + Letter(c : char) | ||||
|     # printThisAfter() | ||||
|     # printThisBefore() | ||||
|   } | ||||
|   abstract class LetterComposite { | ||||
|     - children : List<LetterComposite> | ||||
|     + LetterComposite() | ||||
|     + add(letter : LetterComposite) | ||||
|     + count() : int | ||||
|     + print() | ||||
|     # printThisAfter() {abstract} | ||||
|     # printThisBefore() {abstract} | ||||
|   } | ||||
|   class Messenger { | ||||
|     + Messenger() | ||||
|     ~ messageFromElves() : LetterComposite | ||||
|     ~ messageFromOrcs() : LetterComposite | ||||
|   } | ||||
|   class Sentence { | ||||
|     + Sentence(words : List<Word>) | ||||
|     # printThisAfter() | ||||
|     # printThisBefore() | ||||
|   } | ||||
|   class Word { | ||||
|     + Word(letters : List<Letter>) | ||||
|     # printThisAfter() | ||||
|     # printThisBefore() | ||||
|   } | ||||
| } | ||||
| LetterComposite -->  "-children" LetterComposite | ||||
| Letter --|> LetterComposite  | ||||
| Sentence --|> LetterComposite  | ||||
| Word --|> LetterComposite  | ||||
| @enduml | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 33 KiB | 
		Reference in New Issue
	
	Block a user