You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[adapter](patterns/structural/adapter.py)| adapt one interface to another using a white-box wrapper |
59
+
|[bridge](patterns/structural/bridge.py)| decouple an abstraction from its implementation |
60
+
|[composite](patterns/structural/composite.py)| encapsulate a group of objects into a single object |
61
+
|[decorator](patterns/structural/decorator.py)| wrap a class to add new functionality without changing its structure |
62
+
|[facade](patterns/structural/facade.py)| provide a simplified interface to a complex system |
63
+
|[flyweight](patterns/structural/flyweight.py)| use sharing to support a large number of objects efficiently |
64
+
|[front_controller](patterns/structural/front_controller.py)| a single entry point for all requests to an application |
65
+
|[proxy](patterns/structural/proxy.py)| an object representing another object |
66
+
|[mvc](patterns/structural/mvc.py)| separate data (model), user interface (view), and logic (controller) |
67
+
68
+
## Behavioral Patterns
69
+
70
+
> Patterns concerned with **communication and responsibility** between objects.
71
+
72
+
```mermaid
35
73
graph LR
36
74
Sender -->|sends event| Observer1
37
75
Sender -->|sends event| Observer2
@@ -45,3 +83,23 @@ graph LR
45
83
46
84
Originator -->|saves state to| Memento
47
85
Caretaker -->|holds| Memento
86
+
```
87
+
88
+
| Pattern | Description |
89
+
|:------- |:----------- |
90
+
|[chain_of_responsibility](patterns/behavioral/chain_of_responsibility.py)| allow multiple objects to handle a request without them needing to know about each other |
91
+
|[command](patterns/behavioral/command.py)| encapsulate a request as an object, allowing for parameterization and queuing |
92
+
|[catalog](patterns/behavioral/catalog.py)| a class that allows looking up other classes based on various criteria |
93
+
|[chaining_method](patterns/behavioral/chaining_method.py)| allow calling multiple methods on the same object in a single statement |
94
+
|[interpreter](patterns/behavioral/interpreter.py)| define a grammar for a language and use it to interpret statements |
95
+
|[iterator](patterns/behavioral/iterator.py)| provide a way to access elements of a collection sequentially |
96
+
|[mediator](patterns/behavioral/mediator.py)| encapsulate how a set of objects interact |
97
+
|[memento](patterns/behavioral/memento.py)| capture and restore an object's internal state |
98
+
|[observer](patterns/behavioral/observer.py)| allow objects to notify other objects about changes in their state |
99
+
|[publish_subscribe](patterns/behavioral/publish_subscribe.py)| allow objects to subscribe to events and receive notifications when they occur |
100
+
|[registry](patterns/behavioral/registry.py)| keep track of all instances of a class |
101
+
|[specification](patterns/behavioral/specification.py)| define a set of criteria that an object must meet |
102
+
|[state](patterns/behavioral/state.py)| allow an object to change its behavior when its internal state changes |
103
+
|[strategy](patterns/behavioral/strategy.py)| define a family of algorithms and make them interchangeable |
104
+
|[template](patterns/behavioral/template.py)| define the skeleton of an algorithm in a method, allowing subclasses to override specific steps |
105
+
|[visitor](patterns/behavioral/visitor.py)| separate an algorithm from the object structure it operates on |
0 commit comments