Design patterns is a term coined to create well known solutions to common issues while developing an application. In any application, there are some issues which need to be tackled in a clever way. Some these include:

  • A connection manager for connecting to remote machines.
  • A mechanism to generate XML from data entered by user or fetched for third party system.
  • A way to provide an overall structure to the project code.
  • Improve the performance of heavy resources.
  • Maintain logs of activities done by the users of application.

Once a solution for a common problem is found. It can be used in future to resolve the same issue arising in other applications.

Design principles vs Design patterns

It is important to note that design principles are different from design patterns. While design principles are general guidelines about designing the application architecture, design patterns are meant to be used only when in a problem scenario. Both design principles and design patterns can be used languages and paradigms. Examples of design principles include SOLID and examples of design patterns include singleton, proxy, builder and prototype etc.

Gang of Four

There are 23 well known design patterns for object oriented programming languages which were defined by a group of four people. This group is popularly known as Gang of Four (GoF). GoF published a book named “Design patterns – Elements of Reusable Software” which describes design patterns that can be used across languages.

Categories of design patterns

There are three categories of design patterns as described below:

Creational patterns

These deal with the creation of objects which are suitable to be used in the application as per requirement. They hide the creation strategy from the requester.

Structural patterns

These patterns make use of classes and objects to create a complex structure which is meaningful at a broader level. A very good example is the decoration of Java I/O classes by adding extra features like buffering, This is done by the use of decorator design pattern.

Behavioral patterns

These are associated with the interaction between objects and classes. The overall principle of all patterns under this category is to allow the interaction between two entities in a way that they are loosely coupled.

Anti-patterns

There is one more terms related to design patterns which is very commonly missed out when reading about design patterns. An anti pattern is a very widely used strategy which is a problematic way to deal with a problem. The term anti-pattern was coined by Andrew Koenig. It is important to be aware of common anti patterns in order to write good and effective software.

An Introduction to design patterns admin Design Patterns
Design patterns is a term coined to create well known solutions to common issues while developing an application. In any application, there are some issues which need to be tackled in a clever way. Some these include: A connection manager for connecting to remote machines. A mechanism to generate XML...
<p>Design patterns is a term coined to create well known solutions to common issues while developing an application. In any application, there are some issues which need to be tackled in a clever way. Some these include: <ul> <li>A connection manager for connecting to remote machines.</li> <li>A mechanism to generate XML from data entered by user or fetched for third party system.</li> <li>A way to provide an overall structure to the project code.</li> <li>Improve the performance of heavy resources.</li> <li>Maintain logs of activities done by the users of application.</li></ul>Once a solution for a common problem is found. It can be used in future to resolve the same issue arising in other applications. </ul> </p> <h2>Design principles vs Design patterns</h2> <p>It is important to note that design principles are different from design patterns. While design principles are general guidelines about designing the application architecture, design patterns are meant to be used only when in a problem scenario. Both design principles and design patterns can be used languages and paradigms. Examples of design principles include SOLID and examples of design patterns include singleton, proxy, builder and prototype etc.</p> <h2>Gang of Four</h2> <p>There are 23 well known design patterns for object oriented programming languages which were defined by a group of four people. This group is popularly known as Gang of Four (GoF). GoF published a book named "Design patterns - Elements of Reusable Software" which describes design patterns that can be used across languages.</p> <h2>Categories of design patterns</h2> <p>There are three categories of design patterns as described below:</p> <strong>Creational patterns</strong> <p>These deal with the creation of objects which are suitable to be used in the application as per requirement. They hide the creation strategy from the requester. </p> <strong>Structural patterns</strong> <p>These patterns make use of classes and objects to create a complex structure which is meaningful at a broader level. A very good example is the decoration of Java I/O classes by adding extra features like buffering, This is done by the use of <a href="http://www.javaexperience.com/design-patterns-decorator-design-pattern/">decorator design pattern</a>.</p> <strong>Behavioral patterns</strong> <p>These are associated with the interaction between objects and classes. The overall principle of all patterns under this category is to allow the interaction between two entities in a way that they are loosely coupled.</p> <h2>Anti-patterns</h2> <p>There is one more terms related to design patterns which is very commonly missed out when reading about design patterns. An anti pattern is a very widely used strategy which is a problematic way to deal with a problem. The term anti-pattern was coined by Andrew Koenig. It is important to be aware of common anti patterns in order to write good and effective software.</p>