-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathGarageStation.cs
34 lines (29 loc) · 857 Bytes
/
GarageStation.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
using System;
namespace CodeSamples.SOLID.S01_SingleResponsibilityPrinciple_SRP
{
/// <summary>
/// Sample used: https://www.dotnettricks.com/learn/designpatterns/solid-design-principles-explained-using-csharp
/// </summary>
public class GarageStation
{
private IGarageUtility _garageUtility;
public GarageStation(IGarageUtility garageUtility)
{
_garageUtility = garageUtility;
}
public void OpenForService()
{
_garageUtility.TurnLightsOn();
_garageUtility.OpenDoors();
}
public void CloseGarage()
{
_garageUtility.TurnLightsOff();
_garageUtility.CloseDoors();
}
public void ServiceAVehicle()
{
Console.WriteLine("...servicing the vehicle!");
}
}
}