What are Design Patterns?

Working everyday and sitting at your desk in front of your computer, you stare into space, trying to figure out how to write a new feature for your software. You know intuitively what must be done, what data and what objects come into play, but you have this underlying feeling that there is a more elegant and general way to write a software.

In fact, you probably don’t write any code until you can build a picture in your mind of what the code does and how the pieces of the code interact. The more that you can picture, the more likely you are to feel comfortable that you have developed the best solution to the problem.

There are problems rarely stay solved after you’ve handled them once. Developers typically regard their work as tackling individual problems by writing code and solving those problems. But the truth is that in any professional environment, developers almost always end up spending a lot more time on maintenance and adapting code to new situations than writing entirely new code.

A design pattern is a general repeatable solution to a commonly occurring problem in software design. It makes your solution easily reusable, extendable, and maintainable. When you are working on a programming problem, the tendency is to program to the problem, not in terms of reuse, extensibility, maintainability, or other good design issues. And that’s where most developers should be putting in more work because they end up spending far more time on such issues than solving the original problem in the long run. It can also speed up the development process by providing tested, proven development paradigms.

In generally, there are three types: creational, structural, and behavioral.

  • Creational Patterns: create objects for you rather than having you instantiate objects directly. This gives your program more flexibility in deciding which objects need to be created for a given case.
  • Structural Patterns: help you compose groups of object into larger structures, such as complex user interfaces or accounting data.
  • Behavioral Patterns: help you define the communication between objects in your system and how the flow is controlled in a complex program.

No comments as yet.

Anonymous - Gravatar

No comments have yet been made to this posting.

Commentors on this Post-

Leave a Comment-

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs are automatically generated. Off-topic or inappropriate comments will be edited or deleted. Email addresses will never be published. Keep it PG-13 people!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

All fields marked with "*" are required.