Facade.
Stuctural design pattern "Facade" used to grant one united inteface for the group of sybsystems. Design pattern "Prototype" is using also like a simple communication interface between subsystems or like an interface between layers in multi-tier application. Anyway, the Facede helps to devide the complex programming system into subsystems and propagate the interfaces between them.
Implementation is simple. We will have the set of internal classes and one front-end facade class which redirect the incoming queryes or just make the front-end interface for subsystems.
In our example we have the complex system represent ( in draft, of course ) the landing gear. The classes "Carriage" and "Casament" are both the internal classes of the system. The "Gear" class is a facade, which taking care about internal parts of the system and propagate the simple interface with two methods: "gear.Remove()" and "gear.Release()".
Let's try to implement this in C#.
|