A design pattern is a named, reusable approach to a recurring software-design problem. It is not finished code and it is not a rule that must be followed. A useful pattern explains the context in which a problem occurs, the forces that make the problem difficult, a general arrangement of collaborating objects, and the consequences of choosing that arrangement.
This course uses the 23 patterns cataloged by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides as a vocabulary for object-oriented design. The goal is not to memorize class diagrams. The goal is to recognize design pressure, compare alternatives, and explain why a pattern is appropriate or unnecessary in a specific program.
By the end of the seven modules, you should be able to:
A pattern name is valuable because it compresses this design knowledge into a shared term. Saying that a component acts as an Adapter or that algorithms are selected with Strategy gives a team a starting point, but the name does not replace an explanation of the local design decision.
Patterns are most useful after a concrete problem has been identified. Adding factories, observers, or decorators before the requirements demand them can produce unnecessary abstractions. Throughout this course, ask four questions before selecting a pattern:
The course project provides one continuing context for answering these questions. You will model traffic moving through an intersection, then use patterns where they clarify object creation, composition, communication, or state-dependent behavior.
Optional reference: Design Patterns: Elements of Reusable Object-Oriented Software. This is an affiliate link; the course can be completed without purchasing the book.