Do you know the common Design Patterns? (Part 1)Last updated by Tiago Araújo [SSW] almost 3 years ago.See history
Design patterns are useful for ensuring common design principlesare being followed. They help make your code consistent, predictable, and easy to maintain.
There are a very large number of Design Patterns, but here are a few important ones.
- IOC | Inversion of Control
Control of the object coupling is the responsibility of the caller, not the class.
- DI | Dependency Injection
Dependencies are "injected" into the dependent object rather than the object depending on concretions.
- Factory | Factory Pattern
Object creation is handled by a "factory" that can provide different concretions based on an abstraction.
- Singleton | Singleton Pattern
Instantiation of an object is limited to one instance to be shared across the system.
- Repository | Repository Pattern
A repository is used to handle the data mapping details of CRUD operations on domain objects.
- Unit of Work | Unit of Work Pattern
A way of handling multiple database operations that need to be done as part of a piece of work.
- MVC | Model View Controller
An architectural pattern separating domain logic (Controller) from how domain objects (Models) are presented (View).
- MVP | Model View Presenter
An architectural pattern deriving from MVC where the View handles UI events instead of the Controller.
Choose patterns wisely to improve your solution architecture. It is assumed knowledge that you know these design patterns. If you don't, read about them on the sites above or watch the PluralSight videos on Design Patterns.