We may earn an affiliate commission when you visit our partners.

Design Patterns

Save

Design patterns are reusable solutions to commonly occurring problems in software design. They provide a way to solve problems in a structured and efficient manner, and can help to improve the quality, maintainability, and extensibility of software systems. There are many different types of design patterns, each with its own specific purpose and application. Some of the most common design patterns include:

Creational Patterns

Creational patterns provide a way to create objects in a controlled and efficient manner. They can help to reduce the complexity of object creation and ensure that objects are created in a consistent and predictable way. Some of the most common creational patterns include:

  • Factory Method: This pattern defines a method for creating objects, but allows subclasses to alter the type of objects that will be created.
  • Builder: This pattern separates the construction of a complex object from its representation so that the same construction process can create different representations.
  • Prototype: This pattern allows you to create new objects by cloning an existing object.
  • Singleton: This pattern ensures that a class has only one instance and provides a global point of access to that instance.

Structural Patterns

Read more

Design patterns are reusable solutions to commonly occurring problems in software design. They provide a way to solve problems in a structured and efficient manner, and can help to improve the quality, maintainability, and extensibility of software systems. There are many different types of design patterns, each with its own specific purpose and application. Some of the most common design patterns include:

Creational Patterns

Creational patterns provide a way to create objects in a controlled and efficient manner. They can help to reduce the complexity of object creation and ensure that objects are created in a consistent and predictable way. Some of the most common creational patterns include:

  • Factory Method: This pattern defines a method for creating objects, but allows subclasses to alter the type of objects that will be created.
  • Builder: This pattern separates the construction of a complex object from its representation so that the same construction process can create different representations.
  • Prototype: This pattern allows you to create new objects by cloning an existing object.
  • Singleton: This pattern ensures that a class has only one instance and provides a global point of access to that instance.

Structural Patterns

Structural patterns provide a way to organize and compose objects. They can help to improve the flexibility and reusability of code by allowing objects to be composed in different ways. Some of the most common structural patterns include:

  • Adapter: This pattern allows objects with incompatible interfaces to work together.
  • Bridge: This pattern decouples an abstraction from its implementation so that the two can vary independently.
  • Composite: This pattern allows you to compose objects into tree structures to represent part-whole hierarchies.
  • Decorator: This pattern allows you to add new functionality to an object without modifying the original object.
  • Facade: This pattern provides a simplified interface to a complex system.
  • Flyweight: This pattern reduces the number of objects created by sharing common objects instead of creating new ones.
  • Proxy: This pattern provides a surrogate or placeholder for another object to control access to it.

Behavioral Patterns

Behavioral patterns provide a way to communicate and interact between objects. They can help to improve the efficiency and flexibility of code by allowing objects to communicate in a structured and predictable way. Some of the most common behavioral patterns include:

  • Chain of Responsibility: This pattern allows a set of objects to handle requests in sequence until one of them handles the request or all of them have failed.
  • Command: This pattern encapsulates a request as an object so that it can be parameterized, queued, logged, or undone.
  • Interpreter: This pattern defines a grammar for interpreting a language and provides an interpreter to execute the grammar.
  • Iterator: This pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
  • Mediator: This pattern defines an object that encapsulates how a set of objects interact.
  • Observer: This pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
  • State: This pattern allows an object to alter its behavior when its internal state changes.
  • Strategy: This pattern defines a family of algorithms, encapsulates each one and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
  • Template Method: This pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
  • Visitor: This pattern allows you to define a new operation without changing the classes of the elements on which it operates.

Path to Design Patterns

Take the first step.
We've curated 24 courses to help you on your path to Design Patterns. Use these to develop your skills, build background knowledge, and put what you learn to practice.
Sorted from most relevant to least relevant:

Share

Help others find this page about Design Patterns: by sharing it with your friends and followers:

Reading list

We've selected 14 books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Design Patterns.
Provides a comprehensive overview of design patterns in Python. It covers a wide range of patterns, and it includes plenty of examples and case studies. It good choice for Python developers who want to learn about design patterns.
Comprehensive guide to design patterns in modern C++. It covers a wide range of patterns, and it includes plenty of examples and case studies. It good choice for C++ developers who want to learn about design patterns.
Classic guide to domain-driven design. It covers a wide range of topics, including design patterns, refactoring, and testing. It good choice for any software developer who wants to improve their skills in domain-driven design.
Classic guide to test-driven development. It covers a wide range of topics, including design patterns, refactoring, and testing. It good choice for any software developer who wants to improve their skills in test-driven development.
Comprehensive guide to agile software development in C#. It covers a wide range of topics, including design patterns, refactoring, and testing. It good choice for any C# developer who wants to improve their skills in agile development.
Comprehensive guide to parallel programming. It covers a wide range of topics, including design patterns, refactoring, and testing. It good choice for any software developer who wants to improve their skills in parallel programming.
Classic guide to enterprise application architecture. It covers a wide range of topics, including design patterns, refactoring, and testing. It good choice for any software developer who wants to improve their skills in enterprise application development.
Provided a comprehensive overview of design patterns for object-oriented software development. It covers a wide range of patterns, and it includes plenty of examples and case studies. It's a really good overview for beginners although it has some years now and the field has evolved a lot.
More accessible introduction to design patterns than the Gang of Four book. It uses a light-hearted and humorous approach to explain the concepts, and it includes plenty of diagrams and examples. It good choice for beginners who want to learn about design patterns.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser