Skip to main content

Object-Oriented Design Patterns: An Introduction

Printer-friendly version

Version of 20 January 20101

In reading about Object-Oriented Programming, one is likely to encounter frequent references to one or another “design pattern”. While the names of some of these patterns may seem to be intuitively clear in intent from the context, the full intent and purpose of the pattern is not likely to be appreciated without some background. It is the intent of this document to provide a very quick introduction to the subject for those working in Object-Oriented ABL.

What is a “design pattern?” The concept and form of design patterns was originated by Christopher Alexander2 in the field of architecture, but has since been adopted in a number of other disciplines, particularly computer science and especially by those doing object-oriented programming3. The essential idea of a design pattern is that it is a formal statement of a common problem along with any conditions and a statement of a solution to the problem. It is not a specific piece of code, but rather the guidelines or recipe for how one can solve the problem. Much as one seeks in OO design to abstract the invariants of sets of problem space entities, patterns abstract the invariants in sets of problem solutions.

Patterns often have an aspect of obviousness about them; i.e., in reading the pattern one may think, “I’ve done that a million times”. However, even if familiar, providing the solution with a name and a formal statement promotes communication and can provide some rigor to what was previously a vague or poorly defined idea. Of course, not every pattern is obvious to every person, so they also have an important rôle in educating those new to the field and in reminding more experienced practitioners of options which they might forget if not recently used.

AttachmentSize
OODesignPatterns_20100120.pdf92.3 KB