I have a control system and I'm doing a triplet cascaded controllers, I have designed an interface like thatIController{void Run();IController *pFirstController;IController *pSecondController;}My question is for design of triplet cascaded controller, what's the best way in terms of storing a pointer to a third controller, or a make a concrete class implementation of the third cascaded controller.
Design of cascaded controllers
c++
What you are trying to accomplish should fit into a Chain of Responsibility design pattern (also here).  In this pattern, each handler (controller in this case) knows only the next controller (but it doesn't know every controller in the chain).Chain of Responsibility is a simple case of Flow-based programming.