Wednesday, August 20, 2008

Design Patterns : An introduction

Design Patterns

Design Patterns are an essential tool for any object orientated programmer who wants to take his/her skills to the next level. Understanding the specifics of Design Pattern practices and methodologies will help developers uncover reoccurring patterns in software development and give them the tools to apply the correct solution.

Types of Design Patterns

  • Informal Design Patterns - such as the use of standard code constructs, best practice, well structured code, common sense, the accepted approach, and evolution over time.
  • Formal Design Patterns - documented with sections such as "Context", "Problem", "Solution", and a UML diagram.

Formal patterns usually have specific aims and solve specific issues, whereas informal patterns tend to provide guidance that is more general. Formal patterns usually have specific aims and solve specific issues, whereas informal patterns tend to provide guidance that is more general.

For example, some patterns provide presentation logic for displaying specific views that make up the user interface. Others control the way that the application behaves as the user interacts with it. There are also groups of patterns that specify techniques for persisting data, define best practices for data access, and indicate optimum approaches for creating instances of objects that the application uses.

The following list shows some of the most common design patterns within these groups:

  • Presentation Logic
    1. Model-View-Controller (MVC)
    2. Model-View-Presenter (MVP)
    3. Use Case Controller
  • Host or Behavioral
    1. Command
    2. Publish-Subscribe / Observer
    3. Plug-in / Module / Intercepting Filter
  • Structural
    1. Service Agent / Proxy / Broker
    2. Provider / Adapter
  • Creational
    1. Factory / Builder / Injection
  • Persistence
    1. Repository

We will see how to use these pattern in the next post.

Happy programming!!!