---
title: "Design patterns and their benefits"
subject: "Software Engineering"
chapter: 5
key: "semester_5/software_engineering:design-patterns"
source: https://www.bctengineer.com/q/semester_5/software_engineering/design-patterns
site: BCT Engineering
---

# Design patterns and their benefits

Software Engineering · Chapter 5: Software Reuse

- Asked in: year not given, 5 marks
- Video: [What are Design Patterns? | Introduction to Design Patterns and Principles | Geekific](https://www.youtube.com/watch?v=mE3qTp1TEbg) — Geekific
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/design-patterns
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-5

## Question

Prepare brief notes on design pattern with statement of their benefits.

## Short answer

A design pattern is a reusable description of a common design problem and the essence of a good solution, with name, problem, solution, and consequences. Types are creational, structural, and behavioural, e.g. Observer. Benefits include proven design knowledge, common vocabulary, better quality, faster design, easier maintenance, language independence, and better documentation.

## Answer

A **design pattern** is a description of a common design problem and the **essence of a good solution** to it, written in a general way so that it can be reused in many different settings. Patterns capture the experience of expert designers. They became widely known through the "Gang of Four" book (Gamma, Helm, Johnson and Vlissides, 1995).

#### Essential elements of a pattern
1. **Name** – a meaningful reference, e.g. *Observer*.
2. **Problem description** – when the pattern applies and what problem it solves.
3. **Solution description** – the classes/objects involved, their relationships and responsibilities; a template, not concrete code.
4. **Consequences** – the results and trade-offs of using the pattern.

#### Kinds of patterns (GoF)
- **Creational** – object creation, e.g. Singleton, Factory Method.
- **Structural** – composing classes and objects, e.g. Adapter, Facade, Composite.
- **Behavioural** – communication between objects, e.g. Observer, Strategy, Iterator.

#### Example: Observer pattern
**Problem:** several displays must show the same data, and all must update automatically when the data changes.
**Solution:** the data object (*subject*) keeps a list of *observers* and calls `update()` on each when its state changes.

```text
+----------------+  notifies  +----------------+
|    Subject     |----------->|   Observer     |
|----------------|  1      *  |----------------|
| attach(o)      |            | update()       |
| detach(o)      |            +----------------+
| notify()       |                ^        ^
+----------------+                |        |
        ^                 +----------+ +----------+
        |                 | Bar      | | Pie      |
+----------------+        | chart    | | chart    |
| SalesData      |        | view     | | view     |
+----------------+        +----------+ +----------+
```

When `SalesData` changes, both the bar chart and pie chart views are updated, and new views can be added without changing `SalesData`.

#### Benefits of design patterns
1. **Reuse of proven design knowledge** – solutions already tested in many systems.
2. **Common vocabulary** – saying "use a Singleton" communicates a whole design quickly.
3. **Better quality designs** – patterns promote low coupling, high cohesion and flexibility.
4. **Faster design** – designers do not need to solve known problems again.
5. **Easier maintenance and extension** – structures like Observer or Strategy let new behaviour be added with little change.
6. **Language independence** – patterns can be implemented in any object-oriented language.
7. **Better documentation** – naming the patterns used makes a design easier to understand.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is a design pattern?
   A. A finished program
   B. A description of a common design problem and the essence of a good solution
   C. A UML diagram only
   D. A coding standard
   Answer: B. A pattern is a general description of a problem and its good solution, reusable in many settings. (Key point: Definition)

2. Which is NOT an essential element of a pattern?
   A. Name
   B. Problem description
   C. Complete source code for one language
   D. Consequences
   Answer: C. The elements are name, problem, solution (a template, not concrete code) and consequences. (Key point: Pattern elements)

3. What does the Observer pattern solve?
   A. Creating one instance only
   B. Converting interfaces
   C. Iterating a collection
   D. Updating several views automatically when data changes
   Answer: D. The subject notifies registered observers when its state changes. (Key point: Observer)

4. Adapter, Facade and Composite are which kind of pattern?
   A. Structural
   B. Creational
   C. Behavioural
   D. Concurrent
   Answer: A. They compose classes and objects, so they are structural patterns. (Key point: GoF categories)

## Related in Software Engineering

- [Book store process model](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Abook-store-process-model) — Software Engineering, chapter 2

## Related in other subjects

- [Pattern based design and benefits](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Apattern-based-design-benefits) — Object Oriented Analysis and Design, chapter 3
- [Pattern vs framework; GRASP patterns](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Apattern-vs-framework-grasp) — Object Oriented Analysis and Design, chapter 3
- [Short note: Design patterns in deployment](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Ashort-note-design-patterns-deployment) — Object Oriented Analysis and Design, chapter 3
- [Framework and design pattern with example](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aframework-design-pattern-example) — Object Oriented Analysis and Design, chapter 3
