As a developer, as we work on enterprise application problems using a programming language. We document the best practices & common recurring problems and proven solutions to those problems.
- The recurring problems and ready-made solutions which can be applied universally are Design Patterns
Design Patterns
- Helps to identify recurring problems + Ready-made solution to it.
Example: If you want to create one instance of the class no matter how many times the objects have been created, we can use a design pattern.
- Idea of design pattern was born in Civil Engineering.
- Gang of Gour have popularized design patterns through their book.
Why Design Patterns
- Reuse of particular situation & solution.
- Application Structure will get better.
- As it is proved and used universally, any developer can understand the flow of Application easily.
- Provides common language across all community.
Types Of Design Patterns
Types of design pattern depends on the problem.
- Core pattern catalogue.
- Java EE patterns catalogue.
Core pattern catalogue -
- Creational Design Pattern (Deals with problem's related to Object creation)
- Structural Design Pattern (Deals with problem's related to Relationship between classes)
- Behavorial Design Pattern (Deals with problem's related to communication should happen between objects and classes)
How To Study & Use Design Patterns?
After learning the basics of object-oriented programming, one should follow the three-step learning process given below:
Acceptance: First, try to accept the fact that design patterns solve commonly occurring problems in object-oriented software design. Hence, when we are developing any object-oriented software we should not complicate the process by reinventing the wheel.
Recognition: Recognize the importance of following the best practices while developing object-oriented software applications. Read about the problems that are solved using design patterns and identify similar problems in your own development work. In this way, we may find a way to use these design patterns efficiently.
Internalization: Once a suitable design pattern is identified for our software application, we can try to implement it and add it internally to our application in such a way that it provides reusability, manageability, and extensibility.
Top comments (0)