/
Program.cs
36 lines (29 loc) · 891 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mediator
{
/// <summary>
/// Mediator pattern - Behavioural pattern
///
/// Purpose
/// (1) Facilitate object communications through a broker (mediator) & avoids direct object to object communication
/// (2) Facilitate loose coupling between objects
/// </summary>
class Program
{
static void Main(string[] args)
{
ATCMediator atc = new ATCMediator();
IFlight kingfisher = new KingFisher();
kingfisher.SetAtc(atc);
IFlight goAir = new GoAir();
goAir.SetAtc(atc);
kingfisher.InitiateConversation();
goAir.InitiateConversation();
goAir.AskForLanding();
Console.ReadKey();
}
}
}