1. 1 of 3
Introduction to Design Patterns
Author: Kasun Ranga Wijeweera
Email: krw19870829@gmail.com
Date: 2021 March 27
The Design Patterns provide general and reusable solutions to
common problems encountered in software designing.
Design Patterns?
They are not finished designs those can directly be converted into
programming codes.
They are not code snippets.
They are not algorithms.
They are not components or libraries.
They are templates to solve problems in Object Oriented Software
Engineering.
They deal with problems those have already been solved by
someone.
They can make the process of development faster by providing
tested and proven paradigms.
Origin of Design Patterns
Design Patterns: Elements of Reusable Object-Oriented Software
[Book by Gama, Helm, Johnson, Vlissides (“Gang of Four”, 1994)]
2. 2 of 3
Four Essential Elements of a Design Pattern
Name
Problem
Solution
Consequences
Benefits of Design Patterns
They enhance quality of software design.
They enable reuse of software architectures extensively.
They capture expert knowledge explicitly.
They speed up production in a team.
Drawbacks of Design Patterns
They do not provide reuse of a direct programming code.
They are not simple.
They are validated through experience and discussion rather than
automated testing.
They may lead teams to suffer from unnecessary overload.
The Three Main Types of Design Patterns
Creational Design Patterns: Deal with initialization and
configuration of classes and objects.
Structural Design Patterns: Describe ways of assembling objects to
implement a novel functionality.
Behavioral Design Patterns: Deal with dynamic interactions among
societies of classes and objects.
3. 3 of 3
List of Creational Design Patterns
Singleton; Simple Factory; Factory Method; Abstract Factory;
Builder; Prototype; Fluent Interface; Object Pool; Lazy Initialization
List of Structural Design Patterns
Façade; Composite; Flyweight; Proxy; Decorator; Adapter; Bridge
List of Behavioral Design Patterns
Chain of Responsibility; Iterator; Command; Template Method;
Strategy; Observer; Mediator; Memento; State; Interpreter; Visitor