What is design pattern?

Design pattern is a general solutions for common case that happen in the programming world. But, we should adapt with with the actual condition. The Design pattern was initiated by Gang of Four (Erich Gamma, John Vlissides, Ralph Johnson, Richard Helm) in the book titled “Design Patterns: Elements of Reusable Object-Oriented Software”, in 1994.
What is the benefit of design pattern?
- With design pattern, we are able to build large scale system with high maintainability
- It is easier to add new function
- It is easier to scale up
- It is easier to solve the defect
- The other side is, we can solve our problem faster
- Basically, design pattern is a generic solutions. So we can adapt the design pattern to solve the problem we face
- Ensure that our code accomplish high quality level
- It is one of the ways how we can avoid “spaghetti” code
Design pattern classification
- Creational pattern
- This design pattern focus on how an object is created
- Structural pattern
- This design pattern focus on how objects and classes is structured
- Behavioral pattern
- This design pattern focus on how objects communicates each other
In the next post, I will write about the Factory Pattern, it is one of the Creational Patterns.
Thanks

Tinggalkan komentar