Posted by: Sukhon | January 6, 2010

How design pattern comes to developer?

Introduction to Design Patterns

Design patterns are basically an extensive method that can be used in solving a variety of different problems.  Design patterns use the principles of Object Oriented Programming (OOP) to help you create code that will be easy for you and the developers who follow you to understand, revise and extend.

The importance of design patterns is that they formally document problems and their solutions. This gives us a means to recognize and refer to known problems. We also have a means for comparing alternative solutions with full awareness of the consequences of each alternative.

By formally describing design patterns for web programming we can capture the knowledge of experts into a form that can be used by any developer. Well-named design patterns will also improve the ability of web developers to communicate their ideas and intended solutions.

Design Patterns are simply defined solutions to common problems.  Design patterns are proven solutions that are implemented over and over again through different projects.  This re-use of the solution itself becomes a pattern.  Don’t be intimidated by the imaginative names given to design patterns, such as illusion, singleton or spectator, they are exactly that just decorative names given to repeatable solutions.

  • A design pattern is  a recommended solution rather than a style that is not implementation specific.  In other words you can take the same design pattern and implement it with any language, of course if the design pattern is an OO design pattern you need to implement it with an object-oriented language.  More importantly the implementation itself may vary from project to project because of project restraints and requirements.
  • A design pattern is NOT a framework, though depending on whom you speak to, a group of design patterns maybe considered as a design framework.

Why Use Design Patterns

Design patterns are not new. In fact, the concepts behind them go back 20+ years but it’s really in the past 4-5 years that they’ve really gained prominence in software development in general. Most PHP developers may first ask why use Design Patterns or why design in the first place.  You will find Design and Design Patterns are beneficial in regards of:

  • Maintenance
  • Documentation
  • Readability
  • Easy when developing in large development teams
  • Reusable by other then yourself

If this indeed is true then object-oriented development and design pattern skills are a definite asset to your resume.  Most enterprise applications that succeed are because of the fact that a good methodology and development process is in place, and apart of that comes design and with design more then likely comes design patterns.

However there is a trade off with design patterns because it adds another layer/component of abstraction there maybe a loss in performance and efficiency.   Granted this may not be noticeable on high-end servers, but could be problem on low-end servers.

Going off topic for moment, this is especially so when developing J2ME mobile applications, this would be prime example where coding like style would be more dominant then object-oriented coding purely for the fact that memory and heap size on mobile devices is limited.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.