Skip to the content.

Design Patterns

© Ioannis Kostaras


Objectives

To be able to:


Introduction

A Design Pattern (DP) is a software engineering problem-solving discipline that emerged from the object-oriented community. Put simply, it is a solution to a common problem, a proven concept that describes deeper system structures and mechanisms.

A Design Pattern

Design patterns are language- and implementation-independent, a “micro-architecture”, adjunct to existing methodologies (e.g. UML)

A Design Pattern has 4 basic parts:

Goals of Design Patterns

Benefits of Design Patterns

GoF Design Patterns

The term “Design Pattern” was introduced in the GoF (Gang of Four) book: “Design Patterns - Elements of Reusable, Object Oriented Software”. The book describes 23 design patterns which are grouped into Scope and Purpose. Scope defines the domain over which a pattern applies. Purpose reflects what a pattern does.

Purpose   Creational Structural Behavioural
  Class Factory Method Adapter (Class) Interpreter, Template Method
Scope - - - -
  Object Abstract Factory, Builder, Prototype, Singleton Adapter (Object), Bridge, Composite, Decorator, Flyweight, Facade, Proxy Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Visitor

But apart from those 23 GoF design patterns, we will present many more. These will include, Concurrent, Enterprise, Integration and Security design patterns.

Design Patterns Template

Name Description
Name The name of the design pattern
Scope Object or Class
Purpose Behavioural, Creational, or Structural
Intent short description of the design pattern and its purpose
Also Known As other names that people have given to the design pattern
Motivation motivating scenario demonstrating the design pattern’s use
Applicability circumstances in which the design pattern applies
Structure graphical representation of the design pattern using UML notation
Participants participating classes and/or objects and their responsibilities; I will use jpatterns annotations
Collaborations how participants cooperate to carry out their responsibilities (I will use jpatterns annotations)
Pros and Conss the results of application, benefits, liabilities
Implementation implementation pitfalls, hints, or techniques, plus any language-dependent issues; sample implementations in Java, C#, C++ and Rust
Known Uses where the design pattern is used in Java, C#, C++ and Rust
Related Patterns other patterns that relate to this one

Conclusion

Design patterns promote:

Bibliography and further reading