Behavioural Design Patterns
Behavioural design patterns focus on communication between objects, defining how they interact while promoting flexibility and loose coupling. These patterns help manage complex control flows, encapsulate algorithms, and delegate responsibilities efficiently.
Common Behavioural Design Patterns
Observer Design Pattern
Allows an object (Subject) to notify multiple observers (Subscribers) when its state changes.
We discuss the example of a stock market app where users subscribe to stock price updates.
The BLOG describes a nice -working example.
Strategy Design Pattern
Defines a family of algorithms and encapsulates each one in a separate class, making them interchangeable.
The BLOG describes the choice of encryption algorithms at runtime using the strategy design pattern.