The general approach that we use for developing code employs layered abstractions.
With this approach, protocols and strategies are implemented at the top layers.
Tactics such as data management and hardware interfacing are implemented at the
In this section, you find a samples of code that utilize two layers. For example, the
C/C++ example demonstrates to you a control thread and a data manager as two layers. At
the top layer, you find a message server thread. This thread implements the strategy
of reading a message and responding to the message. This layer interacts with a lower
layer that handles all message mechanics: reading from the queue and unpacking data
from the message structure.
Look at this code. At the strategic thread layer, you see readable code with clearly
identifiable logic. Within the tactical message layer, you see interactions with the
Windows thread message queue and all sorts of explicit pointer dereferencing.
We use this same layered approach on every kind of software that we develop. We even
use this approach for Windows NT device drivers.
Benefits to this approach are ease in debugging and ease in modification. You obtain
these benefits by separation of control and data management.