-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBridgePatternExampleSingleImplementations.cs
More file actions
34 lines (27 loc) · 1.33 KB
/
BridgePatternExampleSingleImplementations.cs
File metadata and controls
34 lines (27 loc) · 1.33 KB
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
using GofConsoleApp.Examples.Structural.BridgePattern.Implementations;
using GofConsoleApp.Examples.Structural.BridgePattern.Implementations.Single;
namespace GofConsoleApp.Examples.Structural.BridgePattern;
internal class BridgePatternExampleSingleImplementations : BaseExample
{
protected override bool Execute()
{
var emp1 = new Employee("1", "Jane", "Doe");
var emp2 = new Employee("2", "John", "Doe");
IProcess registerEvent = new Registration(Logger);
IManagement annualConference1 = new EventManagement("Annual conference", Logger);
annualConference1.Add(registerEvent);
annualConference1.Execute(emp1);
IManagement annualConference2 = new EventManagement("Annual conference", Logger);
annualConference2.Add(registerEvent);
annualConference2.Execute(emp2);
IProcess taskSalesPitch = new TaskAssignment("Sales pitch", Logger);
IManagement salesTravel = new TravelManagement("Sales", Logger);
salesTravel.Add(taskSalesPitch);
salesTravel.Execute(emp1);
IProcess taskSystemUpgrade = new TaskAssignment("System upgrade", Logger);
IManagement maintenanceTravel = new TravelManagement("Maintenance", Logger);
maintenanceTravel.Add(taskSystemUpgrade);
maintenanceTravel.Execute(emp2);
return true;
}
}