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 focus on memory and runtime requirements this training is also suitable for developers of applications where resource limitation is not an issue.
Pre-requisites:
A good working knowledge of C++ and a basic understanding of object-oriented principles. Experience with UML class diagrams is beneficial but NOT a requirement, as this course also provides the necessary UML knowledge!
Duration:
3 or 5 days ( including practical exercises ). The 3-day-version of this course covers only a subset of the patterns listed below (the detailed course description is available on request).
Course Description:
This course demonstrates under which conditions the classic Design Patterns of the "Gang of Four" (GoF) can profitably be used in resource-constrained embedded systems. It covers a selection of design patterns particularly suited for this purpose, presenting them in the context of hardware-related or other applications, which are characteristic for embedded systems. The classes and relationships necessary for the implementation of the design patterns are not only presented conceptually using UML diagrams, but are also developed step-by-step using complete code examples. This approach allows for a thorough assessment of the memory and runtime cost in relation to the benefits of the used design patterns. Additionally, the examples illustrate how the SOLID design principles of the modern clean code programming work together with the design patterns and how they contribute to the improvement of the software design quality. Finally the course also shows, how patterns can be used to considerably reduce the memory and runtime overhead caused by traditional debugging techniques. This proves that the use of design patterns not only leads to a better software design, but may also contribute to a more efficient use of the system resources, which is particularly important for embedded systems.
Course Outline:
Introduction
- 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 adjustable 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