Note: All descriptions are provided without warranty.
- Iterator
- Description: Provides a way to access elements of an aggregate object sequentially without exposing its underlying structure.
- Observer
- Description: Defines a one-to-many dependency between objects, so that when one object changes state, all its dependents are notified and updated automatically.
- Strategy
- Description: Enables a family of algorithms to be defined, encapsulated, and interchangeable at runtime, allowing the client to choose the desired algorithm.
- Builder
- Description: Separates the construction of an object from its representation, allowing the same construction process to create different representations.
- Factory
- Description: Provides an interface for creating objects, but allows subclasses to decide which class to instantiate.
- Singleton
- Description: Ensures that only one instance of a class is created and provides a global point of access to it.
- Adapter
- Description: Converts the interface of one class into another interface that clients expect, allowing classes to work together that couldn't otherwise due to incompatible interfaces.
- Decorator
- Description: Adds behavior to an object dynamically, without affecting the behavior of other objects of the same class.
- Facade
- Description: Provides a simplified interface to a complex subsystem, making it easier to use and reducing dependencies.
- Description: Demonstrates the difference between abstract classes and interfaces, which are used for defining contracts and providing common behavior in object-oriented programming.
Sources/References:
- Fall 2020 "Software Construction" @ UZH (Prof. Alberto Bacchelli)
- https://refactoring.guru/design-patterns/book
- https://neetcode.io/courses/lessons/8-design-patterns
- https://springframework.guru/gang-of-four-design-patterns/
- Head First Design Patterns (A Brain Friendly Guide) (Book)
- Design Patterns: Elements of Reusable Object-Oriented Software (Book)