How To Learn Design Patterns?
If you came here means you want to know how to learn it(as the topic says) and not to what and why and all those, anyhow I will cover it through from what it is to the how to, so here's the definition, Design patterns are solutions to the repeatable problems occurring in the software design.
why we need Design Pattern?
When we program, we write description intended for two audiences, compiler and the other developers, sometimes it may help yourself after we look at the code written by last year or sometimes even within months. Compiler will be happy until it satisfies the language specification. Developers need to know what functionality it is and why this design and also they want to know what is Robust and Fragile.
Documentation will provide those things, but it changes once the source code modification happens, Design patterns will provide a effective communication between developers they share common vocabularies like sharing design pattern name among developers.
We are going to develop a product(application) only once from scratch, but we will add new features frequently(as the client wants it), so the developers need to change the code based on the client specification sometimes it is easy to add new functionality, sometime developers need to rewrite(design) application from scratch. The design patterns are effective solution to those common OOP problems.
The book Elements of Reusable Object Oriented Software suggested the 23 design patterns based on the common 3 types
- Creational - create objects for you
2. Builder Pattern
- Structural - concern about class and object composition
- Behavioral - communication between objects
- Learn the design pattern(types) description from wikipedia.
- Try to map that pattern with the real world examples.
- Go through the wikipedia sample code and practice it with your favorite IDE.
- Apply learned design pattern in your application,while working on personal project or at the work place.
That's it from today, ciao until next time.
Comments
Post a Comment