11flowchart TD
2- Start [ " What do you need to do? " ] --> Q1 { " Are you creating<br />new objects?" }
2+ Q1 { " Are you creating<br />new objects?" }
33
44 Q1 --> | Yes | Creational [ " Creational Patterns<br />(Object Creation)" ]
5- Q1 --> | No | Q2 { " Are you dealing with< br />object composition <br />or structure?" }
5+ Q1 --> | No | Q2 { " Do you need to organize <br />or structure existing objects ?" }
66
77 Q2 --> | Yes | Structural [ " Structural Patterns<br />(Object Composition)" ]
88 Q2 --> | No | Behavioral [ " Behavioral Patterns<br />(Object Interaction)" ]
@@ -16,41 +16,41 @@ flowchart TD
1616 C3 --> | Yes | AbstractFactory [ " Abstract Factory<br />(Family of objects)" ]
1717 C3 --> | No | Builder [ " Builder<br />(Step-by-step)" ]
1818
19- C2 --> | No | C4 { " Need to clone<br />existing objects?" }
19+ C2 --> | No | C4 { " Do you need to clone<br />existing objects?" }
2020 C4 --> | Yes | Prototype [ " Prototype<br />(Clone objects)" ]
2121 C4 --> | No | FactoryMethod [ " Factory Method<br />(Encapsulate creation)" ]
2222
2323 %% Structural Branch
2424 Structural --> S1 { " Are you wrapping<br />an object?" }
25- S1 --> | Yes | S2 { " Need to change<br />object's interface?" }
25+ S1 --> | Yes | S2 { " Do you need to change<br />an object's interface?" }
2626 S2 --> | Yes | Adapter [ " Adapter<br />(Convert interface)" ]
27- S2 --> | No | S3 { " Adding functionality <br />dynamically?" }
27+ S2 --> | No | S3 { " Do you need to add <br />functionality dynamically?" }
2828 S3 --> | Yes | Decorator [ " Decorator<br />(Add behavior)" ]
2929 S3 --> | No | Proxy [ " Proxy<br />(Control access)" ]
3030
31- S1 --> | No | S4 { " Building a tree<br />structure?" }
31+ S1 --> | No | S4 { " Are you building a tree<br />or hierarchical structure?" }
3232 S4 --> | Yes | Composite [ " Composite<br />(Part-whole)" ]
33- S4 --> | No | S5 { " Simplifying <br />complex system?" }
33+ S4 --> | No | S5 { " Do you need to simplify <br />a complex system?" }
3434 S5 --> | Yes | Facade [ " Facade<br />(Unified interface)" ]
35- S5 --> | No | S6 { " Optimizing <br />memory?" }
35+ S5 --> | No | S6 { " Do you need to optimize <br />memory usage ?" }
3636 S6 --> | Yes | Flyweight [ " Flyweight<br />(Share objects)" ]
3737 S6 --> | No | Bridge [ " Bridge<br />(Decouple interface)" ]
3838
3939 %% Behavioral Branch
4040 Behavioral --> B1 { " Is it about<br />sequencing?" }
41- B1 --> | Yes | B2 { " Pass requests<br />through chain?" }
41+ B1 --> | Yes | B2 { " Do you need to pass requests<br />through a chain of handlers ?" }
4242 B2 --> | Yes | ChainOfResp [ " Chain of Responsibility<br />(Pass along chain)" ]
43- B2 --> | No | B3 { " Execute commands <br />later?" }
43+ B2 --> | No | B3 { " Do you need to execute <br />commands later or queue them ?" }
4444 B3 --> | Yes | Command [ " Command<br />(Encapsulate action)" ]
4545 B3 --> | No | Iterator [ " Iterator<br />(Access elements)" ]
4646
47- B1 --> | No | B4 { " Multiple states <br />or algorithms ?" }
48- B4 --> | Yes | B5 { " Object changes <br />behavior?" }
47+ B1 --> | No | B4 { " Does the behavior need <br />to change dynamically ?" }
48+ B4 --> | Yes | B5 { " Does the object need to change <br />behavior based on internal state ?" }
4949 B5 --> | Yes | State [ " State<br />(Change behavior)" ]
5050 B5 --> | No | Strategy [ " Strategy<br />(Select algorithm)" ]
5151
52- B4 --> | No | B6 { " Need to track<br />changes?" }
52+ B4 --> | No | B6 { " Do you need to track<br />and notify about changes?" }
5353 B6 --> | Yes | Observer [ " Observer<br />(Notify dependents)" ]
54- B6 --> | No | B7 { " Saving/restoring <br />state?" }
54+ B6 --> | No | B7 { " Do you need to save <br />and restore object state?" }
5555 B7 --> | Yes | Memento [ " Memento<br />(Capture state)" ]
5656 B7 --> | No | Visitor [ " Visitor<br />(Add operations)" ]
0 commit comments