Some assumptions are made that a reader is familiar with the underlying design pattern discussed.
This is not about how to implement a specific pattern, but an illustration where certain designs come in handy. My expertise lies in Python, so while this list should be language-agnostic, some Pythonic things may slip.
- Abstract Factory *
- Builder *
- Factory Method *
- Monostate
- Same as Singleton examples, just implementation is slightly different.
- Singleton
- External API that throttles max connections. | Force usage of single API instantiation.
- Prototype *
- Chain of Responsibility
- Exceptions can be operated by numerous interfaces.
- Command
- Job Queues | Passing jobs that can be executed by any machine.
- Interpreter *
- Iterator *
- Mediator
- Mailing Lists & Chatrooms | Mediator decides how and what messages recipients should recieve.
- Memento
- Undo Functionality | Snapshot of before and after action.
- Null Object *
- Observer *
- Null State *
- Strategy *
- State
- Aka a "mode". Emails contain state of "sent", "unsent".
- Template Method *
- Visitor
- Calculating taxes in different regions on sets of invoices would require many different variations of calculation logic. Implementing a visitor allows the logic to be decoupled from the invoices and line items.
- Adapter *
- Bridge *
- Composite *
- Decorator *
- Facade
- Python's os.path | Simplify extensive upstream interface. Simplies split + indexing
- Flyweight *
- Proxy *