| home | > | Design Patterns |
When was the first time you used a Pattern? Me, probably the making Christmas cookies when I was a kid. You, know those plastic or tin cookie cutters you would use to make Snowmen, Christmas trees and stars? Those were patterns. Ever think of why they have sidewalks in your neighborhood? The sidewalks are the result of implementing the pattern for your residential neighborhood, clearly defined boundries for pedestrian and vehicular traffic. Essentially, a pattern is used over and over again to create an identical solution. Software design patterns are no different, they provide a solution to a recurring software design problem.
According to Gamma, Helm, Johnson and Vlissides (the Gang of Four) a pattern has four essential elements. (GoF: Design Patterns, Elements of Reusable Object-Oriented Software, 1995)
The design patterns that I have described in the following pages have been described using the Java programming language. Of course, all of these Patterns can be applied using any language, but the implementation will be different. Where possible I have included a small zip file containing the code for each example.
Singleton Design Pattern