What Is the Gang of Four?

Even those who work in or for other reasons stay relatively up-to-date with major developments in the computer science space may be familiar with the cryptic sounding Gang of Four, but only vaguely so.

So, what is the Gang of Four?

Rather than be a cabal of ambitious government legislators or a shady conspirator group, GOF is a net jargon short-hand for the book, “Design Patterns: Elements of Reusable Object-Oriented Software.”

This Gang of Four specifically refers to Erich Gamma, Ralph Johnson, John Vlissides, and Richard Helm, the book’s authors. The primary focus of Design Patterns is the pros and cons of using object-oriented and an overview of different software design patterns.

Having sold a reported 500,000 copies, the book received a 4.5 out of 5-star rating following hundreds of reviews on Amazon.com. Despite its age, it is considered by industry experts to be one of the best publications on the subject of object-orientated design.

In fact, years after its publication, Design Patternsauthors were given the ACM SIGPLAN Programming Languages Achievement Award for the monumental impact their book had “on programming practice and programming language design” in 2002.

Originally published in 1994, this work still holds up and for a programmer, particularly one with a background in C++, definitely worth a read.

The First Section of Design Patterns – Fundamentals

Divided into two major sections, Design Patterns first focuses on the fundamentals of and means to create proper software that is primarily object-oriented. Authors refer to their own experience and how they personally have implemented the techniques that they describe. Specifically, other core concepts which are covered include the benefits of inheritance over implementation and the composite reuse principle – or as it is more commonly known as ‘composite over inheritance.’

Keep in mind some of the terms used in the book, this section, in particular, does use antiquated or less commonly used terms by contemporary programmers. For example, the word ‘toolkit’ is used instead of ‘class library,’ so referencing a programming term dictionary may be necessary for the less experienced.

The Second Section of Design Patterns – Applications

The second section of the book begins by focusing on a case study, which examines What-You-See-Is-What-You-Get (or WYSIWYG) document editing. The study addresses seven problems which should be confronted when performing a Lexi design and how to develop solutions using a combination of pseudo-code and some amount of augmented Object Modeling Technique.

Finally, this section describes 23 different design patterns including reference links which elaborate on each pattern in detail and how they are implemented when addressing the seven primary problems which arise when using a WYSIWYG editor.

Further, each design patterns template source code is given, as are illustrative visual diagrams, and real-world applications of each pattern using C-based code. The 23 patterns can be divided into three categories:

  • Creational Patterns – patterns which provide a means to represent an individual object or a series of related objects.
  • Structural Patterns – patterns which relate to the specify the relationship between objects or classes.
  • Behavioral Patterns – patterns which relate to the communication between objects and classes.

Fortunately for the reader, especially beginner programmers, the authors now provide a condensed, free reference sheet which lists patterns in a UML format which can be downloaded via BlackWasp.com. Considering how dense the material covered in Design Patterns is, it is highly recommended that you download and refer to this sheet often both while and after reading the book.

Should Non-Experts Be Intimidated by This Publication?

In short, no.

As previously implied, even those who don’t program in C++ can learn from and incorporate the fundamentals of this book.

Design Patterns generally isn’t too ‘snobbish’ in the sense that overly complex or obscure jargon is not used. Additionally, the coding illustrations used should be intelligible to anyone who has some familiarity with C-based programming languages.

In fact, this book in many ways, is an excellent resource for beginners as well as struggling computer programmers with moderate experience. As computer scientist, Richard P. Gabriel summed up the benefits of reading Design Patterns “[t]hink of the GOF as helping losers lose less.”

However, remember that this book is considered to be a leading publication in its niche, and is hardly light reading.

Enterprise software experts, such as Martin Fowler, suggest that a reader should at least have a good grounding in OO design principles. On top of that, the book is over a couple decades old, and so some portions of the specific data presented is a bit out of date.

That said, all of the core fundamentals are relevant, especially when one considers all of the .NET and Java libraries which incorporate GOF design patterns. Furthermore, the consensus of expert programmers, including those who have criticized the book, decades after publication, describe Design Patterns as an essential go-to reference for aspiring programmers.

Hiring? Job Hunting? Post a JOB or your RESUME on our JOB BOARD >>

Subscribe to our newsletter for more free interview questions.