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 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. Knowledge of basic UML (Unified Modeling Language) is useful but not a requirement. With respect to UML diagrams this training teaches everything that is needed in this course.
Duration:
5 days ( including practical exercises )
Course Description:
This course shows under which conditions classical GoF 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. This approach not only demonstrates the features of the patterns but also allows for a well-grounded assessment of the patterns' cost in relation to their benefits. Another focus of this course is the memory and runtime overhead which is produced by the use of classical debug techniques and how patterns can be used to solve this problem. So, this couse not only shows why design patterns lead to better code quality but also why they are useful especially 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 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