Add code examples, and documentation
This commit is contained in:
36
patterns/facade/CarEngineFacadeRecording/Program.cs
Normal file
36
patterns/facade/CarEngineFacadeRecording/Program.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
#region
|
||||
|
||||
using CarEngineFacadeRecording;
|
||||
|
||||
#endregion
|
||||
|
||||
//// without the facade, starting the engine involves creating all the objects
|
||||
//var airflow = new AirFlowController();
|
||||
//var fuel = new FuelInjector();
|
||||
//var start = new Starter();
|
||||
//var cool = new CoolingController();
|
||||
//var cat = new CatalyticConverter();
|
||||
|
||||
//// then performing all the steps in the correct order
|
||||
//airflow.TakeAir();
|
||||
//fuel.On();
|
||||
//fuel.Inject();
|
||||
//start.Start();
|
||||
//cool.Run();
|
||||
//cat.On();
|
||||
|
||||
//// and shut down also requires steps in the correct order
|
||||
//fuel.Off();
|
||||
//cat.Off();
|
||||
//cool.Cool();
|
||||
//cool.Stop();
|
||||
//airflow.Off();
|
||||
|
||||
// with the Facade, all creation is handled internally
|
||||
var facade = new Facade();
|
||||
|
||||
// as is starting
|
||||
facade.Start();
|
||||
|
||||
// and stopping
|
||||
facade.Stop();
|
||||
Reference in New Issue
Block a user