Behavioral Design Pattern
Behavioral Design Pattern
The Behavioral Design Pattern focuses on how objects interact and communicate. Some types include:
1. Observer Pattern: Defines a one-to-many dependency between objects, ensuring that when one object changes state, all its dependents are notified.
2. Strategy Pattern: Defines a family of algorithms, encapsulates each one, and makes them interchangeable. It lets the algorithm vary independently from clients that use it.
3. Command Pattern: Encapsulates a request as an object, allowing parameterization of clients with different requests, queuing of requests, and logging of the actions.
4. Chain of Responsibility Pattern: Passes a request along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.
5. State Pattern: Allows an object to alter its behavior when its internal state changes. The object will appear to change its class.
6. Visitor Pattern: Represents an operation to be performed on the elements of an object structure. It lets you define a new operation without changing the classes of the elements on which it operates.
7. Template Method Pattern: Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.
8. Interpreter Pattern: Defines a grammar for interpreting the sentences in a language and provides an interpreter to interpret the sentences.
9. Memento Pattern: Captures and externalizes an object's internal state so that the object can be restored to this state later.
10. Iterator Pattern: Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
These patterns collectively contribute to making software systems more modular, extensible, and easier to understand by addressing various aspects of behavior and communication between objects.
Comments
Post a Comment