News - Happenings at iGeeks

August 31st, 2004

Design Pattern

How many programmers in this world screams that “every program is a problem”? I say many. Because every step in writing a code is a struggle one finds in early stages of development. Inspite of learning OOPS concepts, many still find it hard to really implement to get maximum benefit out of the same.

Why is to so?

Because most of oops concepts we see as Classes, Objects, Inheritance, Composition, Encapsulation, Polymorphism, Dynamic Binding etc. But had we ever thought of a mechanism of interaction between classes, instances (Objects) to escape from common pitfalls?

The real challenge in OOP is a “Design Architecture“. I mean Design Architecture is a method or pattern which will clearly explain the entire flow of organization and structure of OOP models. If there is a real pattern which describes the “Relationship and behaviors of classes in interaction with the other classes and instances” then we must say “Mantra”.

Mantra is “Design Pattern

Design patterns are descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context. A design pattern names, abstracts and identifies the key aspects of a common design structure that make it useful for creating reusable object-oriented design. In realty, OOPS means the time which you have spent earlier, must be reused for the future.

Note:

  • A design pattern does not describe the entire structure of an application neither does it describe a specific algorithm or procedure in an application. It is totally a misconception to describe design pattern to be a part of your logic in program.
  • Your logic phase have nothing to do with design. For example, you may write a procedural code to develop a search engine. Same routine can be implemented in OOPS concept with some good pattern. Here ”base logic is same in both cases“, the only differences is style of programming one adopt. It is better to adopt OOPS for various resons like
  • Reusability
  • Maintainability
  • Extensibility
  • Portability

    Once we adopt Design patterns it is very easy for other programmers to work for further improvement. Most widely and commonly accepted design patterns (almost nearly every application uses the following)
  • Observer Design Pattern
  • Singleton Design Pattern
  • Model - View - Controller (MVC)
  • Model - View - Presenter (MVP)
  • Delegation Event Model

We shall see it next article about application of patterns with live examples.

Santosh

Comments

my dear man, when u put things in quotes, u do not need to capitolize very letter within those quotes…

jason