Design Patterns in C++

Course objectives

After completing this course you will be able to:

  • improve the design of your object-oriented code
  • apply the principles of Clean Code and SOLID OOP to your project
  • recognize the context in which the appropriate design pattern can be implemented
  • implement the appropriate pattern
  • refactor the legacy code to patterns (Refactoring to Patterns)

Course syllabus

S.O.L.I.D. OOP

  • Polymorphism in modern C++
    • Dynamic polymorphism – inheritance, virtual methods and late binding
    • Static polymorphism - templates
    • Using std::variant<Ts...> for polymorphism
    • "duck typing" – polymorphic (type-erased) wrappers
  • Dependency Injection
    • How to inject dependecies in classes
    • DI libraries in C++
  • Principles of good object-oriented programming – SOLID OOP
    • SRP - Single Responsibility Principle
    • OCP - Open/Close Principle
    • LSP - Liskov Substitution Principle
    • ISP - Interface Segregation Principle
    • DSP - Dependency Inversion Principle

Introduction to design patterns

  • What is design pattern?
  • 4 Elements of a Pattern

Creational design patterns

  • Factories
    • Factory Method
    • Abstract Factory
  • Builder
  • Prototype
  • Singleton

Structural design patterns

  • Adapter
  • Bridge
  • Composite
  • Decorator
  • Flyweight
  • Façade
  • Proxy

Behavioral design patterns

  • Template Method
  • Strategy
  • State
  • Patterns for events handling
    • Chain of Responsibility
    • Observer
  • Command
  • Memento
  • Iterator
  • Mediator
  • Visitor

Prerequisites

Attendance of our Programming in C++ course or equivalent experience with C++

Course duration

3 days, 8 class hours each
On-site course quote

In-house training course.

Run at your company premises.

Get a quote
On-line course quote

In-house training course.

Delivered live in a virtual classroom.

Get a quote
Upcoming public courses

No scheduled dates available for this course?

Request a course