0% found this document useful (0 votes)
22 views2 pages

What's A Design Pattern

Design patterns are standard solutions to common software design problems, serving as customizable blueprints rather than specific code. They differ from algorithms in that they provide high-level descriptions of solutions rather than a fixed set of actions. A typical pattern description includes sections on intent, motivation, structure, and code examples to facilitate understanding and implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

What's A Design Pattern

Design patterns are standard solutions to common software design problems, serving as customizable blueprints rather than specific code. They differ from algorithms in that they provide high-level descriptions of solutions rather than a fixed set of actions. A typical pattern description includes sections on intent, motivation, structure, and code examples to facilitate understanding and implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

9/22/24, 2:22 PM What's a design pattern?

Autumn
Autumn SALE
SALE
  

 / Design Patterns

What's a design pattern?


Design patterns are typical solutions to commonly occurring problems in software design. They are
like pre-made blueprints that you can customize to solve a recurring design problem in your code.

You can’t just find a pattern and copy it into your program, the way you can with off-the-shelf
functions or libraries. The pattern is not a specific piece of code, but a general concept for solving a
particular problem. You can follow the pattern details and implement a solution that suits the
realities of your own program.

Patterns are often confused with algorithms, because both concepts describe typical solutions to
some known problems. While an algorithm always defines a clear set of actions that can achieve
some goal, a pattern is a more high-level description of a solution. The code of the same pattern
applied to two different programs may be different.

An analogy to an algorithm is a cooking recipe: both have clear steps to achieve a goal. On the
other hand, a pattern is more like a blueprint: you can see what the result and its features are, but
the exact order of implementation is up to you.

What does the pattern consist of?


Most patterns are described very formally so people can reproduce them in many contexts. Here
are the sections that are usually present in a pattern description:

Intent of the pattern briefly describes both the problem and the solution.
Motivation further explains the problem and the solution the pattern makes possible.
Structure of classes shows each part of the pattern and how they are related.
Code example in one of the popular programming languages makes it easier to grasp the idea
behind the pattern.

https://refactoring.guru/design-patterns/what-is-pattern 1/2
9/22/24, 2:22 PM What's a design pattern?

Some pattern catalogs list other useful details, such as applicability of the pattern, implementation
steps and relations with other patterns.
Autumn
Autumn SALE
SALE

RETURN READ NEXT

 Design Patterns History of patterns 

Home Refactoring Design Patterns Premium Content   


Forum Contact us

 2014-2024 Refactoring.Guru. All rights reserved. Terms & Conditions Privacy Policy
 Illustrations by Dmitry Zhart Content Usage Policy About us

Ukrainian office: Spanish office:


FOP Olga Skobeleva Oleksandr Shvets
Abolmasova 7 Avda Pamplona 64
Kyiv, Ukraine, 02002 Pamplona, Spain, 31009
 Email:  Email:
[email protected] [email protected]

https://refactoring.guru/design-patterns/what-is-pattern 2/2

You might also like