Appendix 5Example OS Isolation Layer

In Chapter 11, SOLID, Flexible, and Testable Designs , we looked at the Open Closed Principle (OCP) and Liskov Substitution Principle (LSP). These principles are about creating plug-compatible software. In this appendix, we are going to look at making an operating system isolation layer. The layer is designed to allow your product’s core application to run in different operating system environments.

We’ll call this OS isolation layer MyOS. The layer assures a common interface, as well as plug-compatible behavior across multiple operating systems. We’ll talk about one small part of the layer, thread creation, and look at three substitutable implementations to illustrate OCP and LSP.

MyOS must run on ...

Get Test Driven Development for Embedded C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.