Saturday, October 10, 2015

Design Patterns

This post serves as an introduction on a series of tutorials I plan to do on design patterns. Design patterns, in software engineering, are “best practices” solutions to common challenges faced when designing software. The design patterns are not packaged designs, ready to be developed and compiled but rather instructions or suggestions on the best approach to design applications using proven paradigms.

The design patterns became widely popular among developers thanks to the "Design Patterns: Elements of Reusable Object-Oriented Software" book, authored by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (also known as "Gang of Four").

Design patterns are usually placed under one of the following categories:
  • Creational, which concern patterns used to decouple construction of objects from their implementing system
  • Structural, where patterns use many disparate objects to compose structures with new and greater functionalities
  • Behavioral, which are patterns mainly concerned with relationships, functionalities and communication between objects
Use of design patterns provides many advantages when designing software. They provide a common terminology, meaning that with only a pattern name a software developer can communicate a whole design approach to colleagues. Additionally, they result into better software designs and applications because they give tested and proven recipes used by many. Also they facilitate faster development because the design following such patterns is usually clear, reusable and maintainable.

Of course use of design patterns are not a panacea or an insurance for quality design. Design patterns must be selected and used in the appropriate context and for the specific problem. Trying to fit as much design patterns as possible in the design of an application can result to unnecessary complexity and bad design. Also, design patterns do not take into consideration the use of specific languages, meaning that a pattern could be simplified or eliminated by using features of programming languages and paradigms (e.g., functional programming). As we will see in future tutorials I plan to do for design patterns, the implementation of patterns with Java 8 can be quite different by implementation with its prior versions.

As mentioned earlier I plan to post design patterns in my blog in the near future, but there are already a lot of great resources for design patterns, and below are some of my favorite:

No comments:

Post a Comment