We may earn an affiliate commission when you visit our partners.
Course image
Umar Lone

Design Patterns are a way to solve common object oriented design problems. But understanding and learning design patterns is hard and takes time. Looking at a pattern is like looking at a solution without a problem, unless you've encountered the problem in the past.

Read more

Design Patterns are a way to solve common object oriented design problems. But understanding and learning design patterns is hard and takes time. Looking at a pattern is like looking at a solution without a problem, unless you've encountered the problem in the past.

This course aims to help you understand & implement Structural Design Patterns. Each pattern is explained with multiple examples and through modern C++. This helps you understand how the pattern can be implemented efficiently using language features. I provide real-world  examples written in Modern C++. These examples will compile & execute on any platform that supports a C++ compiler.

This is how the course teaches structural patterns.

  1. The intent, structure of the pattern is explained through UML class diagram.

  2. Basic implementation details of the pattern are explained.

  3. The pattern is implemented in a simple example.

  4. You get familiar with the overall implementation of the pattern.

  5. Another example is introduced that has design issues the pattern aims to resolve.

  6. We examine the issues and refactor the code by applying the design pattern step by step.

  7. Alternative scenarios & examples are explained along with differences between them. You also learn how to decide between different alternatives.

  8. I discuss the pattern in context of C++ and how to tweak it for performance, reusability & maximum flexibility.

  9. Finally, you'll learn when to use the pattern and its pros & cons.

This is an intensive discussion that spans multiple lectures. At the end of each section, you'll understand the pattern in depth and can apply it in your code or easily clear any design interview.

Enroll now

What's inside

Learning objectives

  • Understand what structural design patterns are
  • How structural patterns help create bigger structures through inheritance & composition
  • Use adapter to convert an incompatible interface into a compatible one
  • Simply the complex interfaces of a system through facade
  • Use proxy to control access to an object
  • Understand how decorator can be used to add more behaviors to an object at runtime
  • Form larger structures through recursive composition through composite
  • Enable sharing of large number of objects through flyweight
  • Separate abstraction & its implementation to provide variations without implementing too many classes

Syllabus

Introduction

Course introduction.

Understand what a pattern means.

A quick primer on UML class diagrams.

Read more

Understand the basics of SOLID principles. This lecture explains the single responsibility & open closed principle.

Understand the liskov substitution principle.

This lecture explains the interface segregation & depending inversion principle.

Gives an overview of the structural patterns.

Download the slide deck used in the videos.

Note: The slide deck is password protected & must be opened as read-only when prompted for a password.

Introduction to the Adapter Pattern.

Basic code example of the pattern and the participants & their interactions.

Game input example.

Understand why we need the adapter pattern.

Object adapter implementation in the game.

Example of how to implement a class adapter.

Pros & cons of the adapter pattern.

Introduction to the facade pattern.

Basic implementation of the facade.

Using Console API to write colored text.

Issues with the implementation.

Implementing the Console class as a facade.

Using the Console class from the client code.

Adding support for Linux.

Pros & cons of the facade pattern.

Introduction to the proxy pattern.

Basic C++ implementation of the proxy.

Introduction to the virtual proxy.

Implementing the Imageviewer application.

Applying the virtual proxy.

Protection proxy introduction.

Creating the repository example.

Applying the protection proxy.

Introduction to the remote proxy.

Sprite animator example.

Using the remote proxy as a COM component.

Smart pointer as a proxy.

Pros & cons of using the proxy.

Introduction to decorator pattern.

Basic example of the decorator.

Adding the abstract Decorator class.

Explanation of the Streams application & implementation of file stream classes.

Explanation of how to add buffering to streams.

Adding the BufferedStream class.

Adding encrypting & compression support to streams.

Using composition instead of inheritance.

Adding the Decorator abstract class in both input & output stream class hierarchies.

Discussion on the types of decorators.

Explanation & implementation of static decorator.

Explanation & implementation of functional decorator.

Pros & cons of the decorator pattern.

Introduction to composite pattern.

Discussion of the intent & implementation overview.

Basic implementation of the composite.

Explanation of the user-interface example.

Adding the UI class hierarchy.

Discussion of the issues in the example.

Adding support for parent pointer.

Pros & cons of using the composite pattern.

Outlines the steps for simple2d library installation. Download the library from here : https://github.com/simple2d/simple2d/releases/tag/v1.2.0

Introduction to the bridge design pattern.

Intent of the pattern and overview of the implementation.

Basic implementation of the bridge pattern.

Discussion of the Shape hierarchy and implementation of the Line class.

Adding more shape classes.

Adding support for rendering through OpenGL.

Discussion of the issues with the design.

Implementing the bridge pattern in the shape drawing application.

Discussion of the handle-body idiom.

Creating the String class.

Implementing sharing for String objects.

Discussion of the PIMPL idiom.

Implementing PIMPL to remove compilation dependencies.

Discussion of the static bridge.

Pros & cons of using the pattern.

Introduction to the flyweight pattern.

Discussion of the intent & overview of the implementation.

Basic implementation of the flyweight.

Explanation of the 3d models in game.

Discussion of the issues and their resolution.

Adding the Car class.

Adding StringInfo for sharing internal strings.

Completing the string interning implementation.

Using the Boost.Flyweight for interning.

Pros & cons of using the flyweight pattern.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Uses modern C++ features to implement structural design patterns, which allows developers to understand how to use language features efficiently
Explores structural design patterns, which are a way to solve common object-oriented design problems encountered in software development
Explains each pattern with multiple examples, which helps learners understand the nuances and variations of each structural design pattern
Discusses each pattern in the context of C++, which helps learners tweak it for performance, reusability, and maximum flexibility in their code
Requires familiarity with UML class diagrams and SOLID principles, which may require learners to study these topics beforehand
Uses Simple2D library, which learners will need to download and install to follow along with the bridge design pattern implementation

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Structural design patterns in modern c++

According to potential learners considering this course based on its structure, the course offers a highly structured approach to understanding structural design patterns. It emphasizes implementation using modern C++ features and includes practical, real-world examples that help illustrate pattern application. However, the inherent complexity of the subject matter combined with the use of C++ means it likely requires a solid prerequisite knowledge of C++ and object-oriented principles, and some learners might find the pace challenging on more dense topics. The course aims to provide in-depth coverage of key patterns.
Includes real-world application cases.
"The real-world examples help ground the abstract pattern concepts."
"Seeing how the patterns solve actual design issues is valuable."
"Examples like game input or UI hierarchy make it relatable."
Utilizes current language features.
"Learning patterns using modern C++ features is a big plus."
"I wanted examples relevant to today's C++ practices."
"Good to see how these patterns are implemented in contemporary C++."
Follows a logical teaching flow.
"I appreciate how each pattern is broken down from intent to C++ specifics."
"The step-by-step refactoring examples are very helpful."
"Understanding the pattern first, then seeing the C++ implementation makes sense."
Could be fast on dense topics.
"Sometimes the lectures felt a bit rushed on complex patterns."
"I had to pause and rewatch certain sections frequently."
"Keeping up with all the implementation details was challenging at times."
Topics are inherently challenging.
"Design patterns themselves are complex, require focus."
"Implementing these patterns in C++ takes careful attention."
"It's not an easy subject, requires dedicated study."
May require strong C++ background.
"I felt I needed a solid understanding of C++ OOP before starting."
"Some examples move quickly if you aren't very familiar with C++."
"This course is best suited for intermediate to advanced C++ developers."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Structural Design Patterns in Modern C++ with these activities:
Review SOLID Principles
Reinforce your understanding of SOLID principles, as they are foundational to understanding the rationale behind many structural design patterns.
Browse courses on SOLID Principles
Show steps
  • Read articles or watch videos explaining each SOLID principle.
  • Identify examples of code that violate each principle.
  • Refactor the code to adhere to SOLID principles.
Review 'C++ Concurrency in Action'
Gain a deeper understanding of concurrency concepts relevant to implementing certain structural patterns, particularly the Remote Proxy.
Show steps
  • Read the chapters related to multithreading and asynchronous operations.
  • Study the code examples and understand how to use C++ concurrency features.
  • Relate the concurrency concepts to the implementation of the Remote Proxy pattern.
Review 'Design Patterns: Elements of Reusable Object-Oriented Software'
Gain a deeper understanding of the theoretical underpinnings of structural design patterns by studying the original design patterns book.
View Design Patterns on Amazon
Show steps
  • Read the chapters related to structural design patterns.
  • Study the UML diagrams and code examples (in C++ if possible).
  • Compare the patterns discussed in the book with those covered in the course.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Create a UML Diagram for Each Pattern
Improve your understanding of the structure of each design pattern by creating UML diagrams that visually represent the classes and relationships involved.
Show steps
  • Review the UML diagrams presented in the course for each pattern.
  • Use a UML diagramming tool (e.g., Lucidchart, draw.io) to create your own diagrams.
  • Compare your diagrams with the ones in the course and identify any differences.
  • Refine your diagrams until they accurately represent the structure of each pattern.
Implement a Text Editor with Decorator Pattern
Solidify your understanding of the Decorator pattern by implementing a text editor with features like bold, italic, and underline using decorators.
Show steps
  • Define the core text editor component interface.
  • Create concrete text editor component implementations.
  • Implement decorator classes for adding formatting options.
  • Compose different decorators to achieve various formatting combinations.
Create a Blog Post on Adapter Pattern
Reinforce your understanding of the Adapter pattern by explaining it in a blog post with real-world examples and C++ code snippets.
Show steps
  • Research and gather information about the Adapter pattern.
  • Write a clear and concise explanation of the pattern's intent and structure.
  • Provide C++ code examples demonstrating different adapter implementations.
  • Illustrate the pattern's use with real-world scenarios.
  • Publish the blog post on a platform like Medium or your own website.
LeetCode Problems on Tree Structures
Improve your understanding of the Composite pattern by solving LeetCode problems that involve tree structures and recursive algorithms.
Show steps
  • Search for LeetCode problems tagged with 'Tree' or 'Depth-First Search'.
  • Identify problems that can be solved using the Composite pattern.
  • Implement solutions in C++ using the Composite pattern.
  • Analyze the time and space complexity of your solutions.

Career center

Learners who complete Structural Design Patterns in Modern C++ will develop knowledge and skills that may be useful to these careers:
Software Architect
A software architect is responsible for making high-level design choices and dictating technical standards, including software coding standards, tools, and platforms. This course may be useful as it covers structural design patterns, which are essential for creating robust and maintainable software architectures. The course's focus on modern C++ and real-world examples can directly inform a software architect's decisions on how to implement patterns in their projects, ensuring that the application is efficient and scalable. The coverage of UML class diagrams may be useful for communicating design ideas.
Senior Software Engineer
A senior software engineer typically leads development teams and makes key technical decisions. This course helps advance a senior software engineer's expertise, particularly in the realm of object-oriented design and implementation. The course emphasizes practical application through C++ examples. A senior engineer can leverage the understanding of structural design patterns like Adapter, Facade, and Proxy to deliver more modular, extensible, and maintainable codebases. In particular, the sections on refactoring code using design patterns are relevant.
Technical Lead
A technical lead guides a team of developers, making sure they are aligned with the technical vision of a project. This course may be useful because it provides the technical lead with a deeper understanding of structural design patterns. This helps them guide their team in implementing these patterns effectively. The course's discussion of trade-offs, pros, and cons of each pattern, particularly in the context of C++, may inform decisions on when and how to apply them. The section on SOLID principles is quite relevant as well.
Application Developer
Application developers design, code, test, and debug applications. This course helps an application developer write better code by teaching them structural design patterns. These help in creating applications that are scalable, robust, and easy to maintain. The course's practical examples in C++ may be useful for immediate application in real-world projects. The discussion of the adapter pattern is relevant to integrating different systems.
Software Developer
Software developers write, test, and maintain software code. Taking this course helps equip a software developer with a strong understanding of structural design patterns. This knowledge is critical for writing clean, efficient, and maintainable code. The course's focus on modern C++ and practical examples will enable developers to immediately apply these patterns in their projects. The discussion of UML class diagrams may be useful for collaborating with other developers.
Systems Architect
A systems architect defines the overall structure and behavior of computer systems. This course provides valuable insights into structural design patterns, which are crucial for designing scalable and maintainable systems. The course's detailed explanations of patterns like Bridge, Composite, and Flyweight can inform a systems architect's decisions when designing complex systems. A systems architect may find the coverage of different implementation strategies helpful.
Game Developer
Game developers create video games for computers, consoles, and mobile devices. This course may be useful to game developers since it teaches structural design patterns, which can improve the architecture and performance of game code. The course uses C++ examples that are applicable to game development. Patterns such as Flyweight and Composite are particularly relevant for managing game assets and user interface elements efficiently. The coverage of the adapter pattern is relevant to handling user input.
Embedded Systems Engineer
An embedded systems engineer designs, develops, and tests software for embedded systems, which are computer systems with a dedicated function within a larger mechanical or electrical system. This course may be useful as it provides the engineer with a deeper understanding of how structural design patterns are implemented. This can inform decisions about how best to approach the design of embedded systems. The course's coverage of Flyweight may be useful in situations where the system has limited memory resources.
Firmware Engineer
A firmware engineer develops low-level software that controls hardware devices. This course may be useful to a firmware engineer. The course's coverage of structural design patterns in C++ may be useful for writing efficient and robust firmware. The course's focus on patterns like Adapter and Proxy may improve the flexibility and security of firmware designs. In cases where memory is restricted, the section on Flyweight may be useful.
Computer Science Professor
A computer science professor teaches undergraduate and graduate courses in computer science. They also conduct research and publish their findings. This course may be useful as it provides a structured overview of structural design patterns. A computer science professor can use the course material to enhance their lectures and provide students with practical examples of pattern implementation in C++, which can then be transferred to other languages and paradigms. They may find the coverage of UML class diagrams useful for illustrating concepts.
Data Structures and Algorithms Engineer
Data structures and algorithms engineers design and implement efficient ways to store and manipulate data. This course may be useful since it helps them understand how to structure code for maintainability and scalability, complementing their knowledge of data structures. The course's focus on C++ may improve the efficiency of their implementations. The discussion of Flyweight may be useful when dealing with memory intensive applications.
Robotics Engineer
Robotics engineers design, build, and program robots. This course may be useful since it can help robotics engineers design the software architecture for robots, promoting modularity and reusability. The course's C++ examples may provide practical guidance for implementing control systems and sensor interfaces. The section on the adapter pattern is useful for connecting disparate hardware systems.
Software Consultant
Software consultants advise organizations on how to use software and technology to achieve their business goals. This course may be useful as it provides the consultant with a deeper understanding of structural design patterns. This helps the consultant recommend appropriate design approaches to clients. The course's coverage of trade-offs, pros, and cons of each pattern will inform consultant's recommendations. The discussions of the adapter and bridge patterns may be particularly helpful in connecting existing information systems.
Quality Assurance Engineer
Quality assurance engineers test software to ensure it meets quality standards and user requirements. This course may be useful as it gives the engineer a better understanding of software design principles. A quality assurance engineer may use this knowledge to write more effective test cases. In particular, understanding design patterns can help in identifying potential areas of complexity or fragility in the code.
Database Administrator
Database administrators are responsible for the performance, integrity, and security of databases. This course may be useful because it provides database administrators with a deeper understanding of how programs interact with data. The course's focus on object-oriented design may better inform decisions about database design and optimization. The section on the proxy pattern may be useful for understanding how to secure sensitive data.

Reading list

We've selected two 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 Structural Design Patterns in Modern C++.
Is the seminal work on design patterns, often referred to as the 'Gang of Four' book. It provides a comprehensive overview of various design patterns, including structural patterns. While the examples are not in modern C++, the underlying principles and UML diagrams are invaluable for understanding the intent and structure of each pattern. This book is highly recommended as a reference text for any serious student of design patterns.
Provides a deep dive into C++ concurrency, which is relevant to understanding the Proxy pattern, especially the Remote Proxy. It explains how to handle multithreading and asynchronous operations, which are often used in remote proxy implementations. While not directly about design patterns, it provides essential background knowledge for implementing certain structural patterns effectively. This book is more valuable as additional reading than as a current reference.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
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 - 2025 OpenCourser