Design Patterns are reusable solutions to common problems in software design, organized by purpose and functionality.
Categories of Design Patterns:
- Creational Patterns: Manage object creation, such as Singleton and Factory.
- Structural Patterns: Deal with object composition, such as Adapter and Composite.
- Behavioral Patterns: Focus on object communication, such as Observer and Strategy.
Examples:
- Singleton: Ensures a class has only one instance.
- Observer: Allows an object to notify others of state changes.
- Factory Method: Defines an interface for creating objects with subclasses.