Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

Behavioral Design Patterns in C++

Packt via Coursera

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Gain a comprehensive understanding of behavioral design patterns in C++ and learn how to implement them in real-world applications. Whether you're working with a simple application or a large enterprise system, these patterns will help you craft solutions that can evolve gracefully over time. The course starts by introducing you to the foundational concepts of behavioral patterns and how they differ from other design patterns. You will dive into patterns like Strategy, Template Method, Command, Memento, Chain of Responsibility, and more. Each section builds upon the previous one, with practical examples and case studies designed to show you how to apply these patterns in real-world scenarios. Throughout the course, you'll learn how to implement these patterns in C++ through hands-on projects, exploring topics like dynamic arrays, undo/redo functionality, multi-threaded applications, and more. You’ll also get a chance to refactor legacy code to incorporate these patterns, enhancing the design of an existing system. This course is ideal for C++ developers looking to advance their understanding of design patterns and improve their software development skills. It is recommended for those with prior knowledge of object-oriented programming and basic C++ syntax. The course is suitable for developers at an intermediate level. By the end of the course, you will be able to identify, implement, and apply key behavioral design patterns in your C++ projects, refactor code for better maintainability, and optimize system design for flexibility and scalability.

Syllabus

  • Introduction to the Course
    • In this module, we will introduce the course structure and explain the key benefits of learning behavioral design patterns in C++. You'll get an overview of the fundamental concepts and how they directly apply to real-world software development. By the end, you’ll have a clear understanding of what to expect and how this course will help you enhance your coding proficiency.
  • Basic Concepts
    • In this module, we will cover the basics of design patterns, class diagrams, and behavioral design patterns. You’ll understand the foundational concepts that underpin many software development practices and how these patterns facilitate creating efficient and scalable solutions. This module is essential for building the groundwork before diving deeper into specific patterns.
  • Strategy
    • In this module, we will delve into the strategy pattern and how it can be implemented to manage algorithms in a flexible way. Through hands-on examples like spreadsheet applications and dynamic arrays, you will learn how to refactor your code to make it more maintainable and extensible. We’ll also cover advanced variations like static strategy and function strategy for efficient runtime decision-making.
  • Template Method
    • In this module, we will introduce the template method pattern and show you how to use it to define the skeleton of an algorithm in a base class while leaving the implementation of specific steps to subclasses. You’ll get hands-on experience applying the pattern to real-world examples, such as document frameworks, and learn how it improves code reusability and maintainability.
  • Command
    • In this module, we will explore the command pattern, focusing on how it can decouple sender and receiver objects. By working through examples like text editors and logging systems, you’ll learn to implement command objects for managing user input and actions like undo/redo. This pattern is essential for creating flexible and extensible software applications.
  • Memento
    • In this module, we will cover the memento pattern and demonstrate how it allows you to store and restore an object’s state without exposing its internal structure. Through examples like banking applications and games, you’ll learn how to effectively implement memento for state management, providing a mechanism for undo/redo functionality and preserving the state of complex systems.
  • Chain of Responsibility
    • In this module, we will explore the chain of responsibility pattern and its ability to decouple request senders from receivers. We’ll apply the pattern to real-world examples like help systems and logging systems, where requests are passed along a chain of handlers. This approach simplifies request processing by allowing multiple handlers to take action without direct dependencies.
  • Observer
    • In this module, we will dive into the observer pattern, which enables objects to notify others about state changes. Through examples like alarm systems and sensor applications, you’ll learn how to use this pattern to create loosely coupled systems where one object’s change in state automatically triggers updates in other objects. This is crucial for building reactive systems.
  • Mediator
    • In this module, we will explore the mediator pattern, which simplifies interactions between objects by introducing a mediator that controls communication. By working through examples like chat systems and dialog boxes, you will understand how this pattern reduces the complexity of object interactions and helps manage dependencies more effectively.
  • Visitor
    • In this module, we will focus on the visitor pattern, which allows you to add new operations to an object structure without changing the classes themselves. Using shape hierarchies and operations like rendering, you’ll learn how to extend functionality while maintaining the flexibility of your system. We’ll also introduce concepts like acyclic visitors and C++17 std::variant.
  • Interpreter
    • In this module, we will cover the interpreter pattern, which helps interpret complex expressions in specific domains. Through examples like Boolean evaluators and reverse Polish notation (RPN) systems, you’ll learn how to define grammars and use interpreters to parse and evaluate expressions, making it easier to implement domain-specific languages and evaluation engines.
  • State
    • In this module, we will focus on the state pattern, which allows an object to alter its behavior based on its internal state. Through examples like a lamp with multiple states and transition tables, you’ll learn how to implement the state pattern for managing state changes. This pattern simplifies handling state-dependent behavior and reduces complexity in your code.
  • Iterator
    • In this module, we will explore the iterator pattern, which provides a way to access the elements of a collection sequentially without exposing its underlying structure. You’ll implement iterators for various containers, including arrays and linked lists, and understand how iterators help create flexible and reusable code for collection traversal. This module also covers C++ iterators and smart pointers for advanced usage.

Taught by

Packt - Course Instructors

Reviews

Start your review of Behavioral Design Patterns in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.