Design Patterns
Design Patterns are nothing but proven solutions to recurring problems.
1. Some favorite design patterns
Creational Patterns
- Prototype
- used to create objects by cloning other objects
- Factory
- Singleton
Structural Design Patterns
They show how the objects are composed, is there an inheritance between them, or is one object composed in another object, interfaces present
Behavioral Design Patterns e.g Iterator, Command
Architectural Design Patterns
e.g MVC pattern
1. Some favorite design patterns
Creational Patterns
- Prototype
- used to create objects by cloning other objects
- Factory
- Singleton
Structural Design Patterns
They show how the objects are composed, is there an inheritance between them, or is one object composed in another object, interfaces present
- Proxy Pattern
e.g credit card is the proxy of the Bank Account
- Decorator
- Adds more functionality without opening the object
- Wraps the decorator another class, it is a component and has a component
- Advantage - allows you to have multiple combinations among classes
- Adapter
- Making two interfaces which are incompatible compatible
- Facade
- Simplify the interactions with too many working complex objects and complex interactions, something you want to call
- Hides complex behavior
Behavioral Design Patterns e.g Iterator, Command
Architectural Design Patterns
e.g MVC pattern
Comments
Post a Comment