Why use design patterns?

In software development, design patterns do not do much in the analysis, testing or documentation phases. But they do have a great impact in the design phase. The design patterns will

  • Help to analyze the more abstract areas of a problem by providing concrete, well-tested solutions.

  • Help to write code faster by providing a clearer picture of how to implement the solution.

  • Encourage code reuse and provide well-tested mechanisms for non-inheritance based reuse techniques like delegation and composition.

  • Encourage more legible and maintainable code.

  • Provide a common language and jargon for programmers.

Patterns do not replace object-oriented analysis but help to think about the problems that may be encountered while designing the system. In order to choose a design pattern, decide whether the problem is creational, structural or behavioral. Sometimes it may be required to mix and match patterns. Study the pattern to know what it does and what to do to use it. Map the generic pattern in the specific problem by renaming the participants and operations in the pattern. Add, remove or reorganize the classes and objects if required. Write the code.

Limitations of Design Patterns

  • Can not find a pattern that fixes every problem.

  • Every pattern has its consequences. So choose the pattern only if it benefits.

  • May need alterations to the pattern to make it work for a given problem.

What is a Design Pattern?
Creational Design Pattern
Structural Design Pattern
Behavioral Design Pattern
Why use Design Patterns?
Want to learn more?

About Us | Contact Us | Disclaimer | Privacy Policy | ©2008 thewebguru.com