Design Patterns for Embedded Systems

Who should attend?

This course is primarily designed for developers, architects or technical leads who are responsible for the development of software for embedded and/or realtime systems with limited resources. Despite its focussing on memory and runtime requirements this class is also suitable for developers of applications where resource limitation is not an issue.


A good working knowledge of C++ and a basic understanding of object oriented principles. Knowledge of basic UML (Unified Modeling Language) is useful but not a requirement for this course.


5 days

Course Description:

This course shows under which conditions standard software design patterns can profitably be used in resource limited environments. A selection of the most suitable patterns is presented based on examples appropriate for embedded systems. Before the patterns are explained on a UML class diagram level, their characteristics are deduced by a stepwise refinement of concrete code examples, which are typical for embedded systems. Furthermore this course highlights new debugging options facilitated by the use of design patterns. As part of the hands-on exercises the pattern costs can precisely be measured with respect to memory consumption and runtime requirements using an ARM code simulator. This approach allows for a well-grounded assessment of a pattern’s costs in relation to its benefits, which is an essential pre-requisite before the pattern can be applied in resource limited systems.

Course Outline:


  • History
  • What is a design pattern?
  • GoF Design Patterns
  • Typical problems in embedded systems
  • Design patterns in embedded systems

Creational Patterns

  • Motor example
  • Interfaces
  • Tracking system example
  • Trolley tracking system
  • Reusing the tracking system for aircrafts
  • Design Pattern Factory Method
  • Design Pattern Prototype
  • Design Pattern Abstract Factory
  • Design Pattern Singleton

Structural Patterns

  • Review of the motor example
  • Design Pattern Adapter
  • Counter classes example
  • Design Pattern Decorator
  • Multithreading example
  • Design Pattern Proxy
  • Design Pattern Flyweight
  • Design Pattern Facade
  • Design Pattern Composite

Behavioural Patterns

  • Timer example
  • Design Pattern Observer
  • Design Pattern Command
  • Finite State Machine example
  • Traditional implementation in C
  • Porting the FSM to C++
  • Design Pattern State
  • Custom memory management example
  • Partition and PartitionManager
  • Flexible memory management using different manager classes
  • Dynamically alterable memory allocation strategies
  • Design Pattern Strategy
  • Algorithms with a fixed base structure
  • Design Pattern Template Method
  • Design Pattern Memento
  • Design Pattern Chain of Responsibility
  • Design Pattern Iterator
  • Design Pattern Mediator

Practical Exercises