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 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 through hardware-related or other applications typical of embedded systems. The classes and relationships necessary for implementing these design patterns are not only presented conceptually through UML diagrams but are also developed step-by-step using fully programmed code examples. This approach enables a thorough assessment of the costs in terms of memory usage and runtime in relation to the benefits of using a design pattern. Additionally, the examples illustrate how the SOLID principles of modern clean code programming work in conjunction with design patterns and how these contribute to the improvement of the software design quality. The course also addresses the memory and runtime overhead caused by using traditional debugging methods and demonstrates how these issues can be resolved using pattern-based solutions. By doing so, it becomes evident that the use of design patterns not only leads to a better software structure but can also result in a more efficient utilisation of the system resources, which is particularly crucial in 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