Add basic memento pattern

This commit is contained in:
Petrutiu Mihai
2016-06-23 20:43:37 +03:00
parent 0a130b0405
commit 37151a23c7
10 changed files with 210 additions and 28 deletions

View File

@@ -9,22 +9,25 @@ namespace MediatorPattern
{
public static void Run()
{
//Console.WriteLine(GetPatternDescription());
//Console.WriteLine(GetActors());
//Console.WriteLine(WhenToUseIt());
//GoToNextStep();
Console.WriteLine(GetPatternDescription());
Console.WriteLine(GetActors());
Console.WriteLine(WhenToUseIt());
Console.WriteLine(GetDisadvances());
GoToNextStep();
//StockExchangeExample stockExample = new StockExchangeExample();
//stockExample.Run();
StockExchangeExample stockExample = new StockExchangeExample();
stockExample.Run();
//GoToNextStep();
//GroundAirTrafficControlExample groundAirControl = new GroundAirTrafficControlExample();
//groundAirControl.Run();
GoToNextStep();
GroundAirTrafficControlExample groundAirControl = new GroundAirTrafficControlExample();
groundAirControl.Run();
//GoToNextStep();
GoToNextStep();
FlightAirTrafficControlExample flightAirControl = new FlightAirTrafficControlExample();
flightAirControl.Run();
}
static string GetPatternDescription()
@@ -54,6 +57,12 @@ But, dont play God!
";
}
static string GetDisadvances()
{
return @"Disatvantages:
Mediator can become ver complicated as more colleagues are handled";
}
private static void GoToNextStep()
{
Console.ReadKey();