Layers:
Nesting layers is kept to a minimum and components are easily accessible. When components are deeply nested, making changes to a component may produce error conditions that are difficult to isolate and identify.
One valid reason to design a second layer is when an external controller or monitor is required. All complex systems should have some form of monitor to report component results, state or condition.
When a controller needs to redirect the process flow, it is essential that the controller have access to the component's state. In complex systems, it is likely that more than one component's state or condition will be used in the decision to redirect flow. It is important that all components whose state affects the process flow be kept on a single layer.
Objects with no more than two layers are a joy to build and maintain.
Copyright © 2020 Lionel Rogers, All rights reserved.