Proper use of design patterns in software development allows you to exploit previous experience with proven arrangements of objects, greatly increasing the efficiency of the coding process. Apply design patterns in your next project and reap the benefits.
By Jeffrey T. Juday
For every development difficulty you encounter, chances are good that another developer has encountered the same problem. Like most developers, you’re pressured to build reliable software fast and meet all requirements. Magic bullets don’t exist in software development; instead, you rely on proven practices and methodologies. Among the better software design practices is the application of design patterns. Design patterns allow you to exploit the experience of your predecessors using proven arrangements of objects.
If you’ve ever used a C# interface, Java interface, or a C++ abstract base class, you’ve probably been applying design patterns and never knew it. Design patterns incorporate some object-oriented concepts with object arrangements to solve common software development design problems. Reusability and extensibility are the center of the design pattern motivation, much like other object-oriented practices. Design patterns are more than basic data structures such as arrays, linked lists, and binary trees. Like data structures, a design pattern name captures a basic idea. Unlike data structures, design patterns define the behavior of groups of objects.
The C# and Java Frameworks are peppered with design patterns and concepts. Many of the objects you utilize in a framework follow a design pattern. A common design pattern practice is to include the name of the pattern being implemented in the name of the object or objects. If you’ve utilized objects in a framework that included words such as proxy, adapter, iterator, visitor, and command in the name of the object, most likely you’ve utilized a design pattern. Understanding design patterns will deepen your understanding of the various C++, C#, and Java libraries and frameworks.
Aside from giving you an under-the-hood understanding of your development tools, applying design patterns will improve your software design, development, and most important, reusability. Design patterns are more than just formulas for software design solutions. An object-oriented approach to software development is the keystone for all design patterns. Understanding the objected-oriented design approach of design patterns is the first step in understanding how design patterns will improve your software development.
Design pattern object-oriented concepts
It’s difficult to write Java or C# without some understanding of object-oriented design and development. Understanding design patterns requires understanding basic object-oriented concepts. If you’ve done development with Java, C++, or C#, you’ll be familiar with the following concepts:
Applying the OO concepts
Using the object-oriented concepts outlined above, design patterns solve problems by applying these concepts in the following ways:
Design patterns in practice
In software design, you must often determine what sorts of objects you need in your design. Many times, the objects you need for your solution are not apparent in the requirements. If the requirements exhibit an interaction that is solved by a design pattern, you can apply the pattern.
A design pattern includes a list of common objects and a description of how the objects interrelate. Some common programming dilemmas are outlined below, along with the design pattern for resolving the dilemma. The examples are provided to give you an idea of the type of problems design patterns can solve.
Where to go from here
If you’re experienced with object-oriented development and design, reading the book Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, is probably all you’ll need. Familiarity with the design pattern catalog should be your initial focus. You’ll be surprised by the number of patterns you’re already familiar with. Further understanding design patterns requires practice. Begin to incorporate design patterns in your development and design. You must begin to put design patterns to work to truly understand their value.
Design patterns incorporate some object-oriented concepts, with object arrangements to solve common software development design problems. Applying design patterns to your design and development will improve your object reuse and allow for easier program changes.