oo-70-245-1

oo-70-245-1 Commit Details


Date:2015-11-02 19:22:16 (9 years 1 month ago)
Author:Natalie Adams
Branch:master
Commit:ca71467ff7e4d77b7e84f379e038b474f5bd7b71
Parents: d4b301bb30924d8c5f10758b9cb30c830086de89
Message:adding facade example

Changes:

File differences

Design Pattern Examples/Facade/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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace facadeexample
{
public class CarModel
{
public void SetModel()
{
Console.WriteLine("CarModel - SetModel");
}
}
public class CarEngine
{
public void SetEngine()
{
Console.WriteLine("CarEngine - SetEngine");
}
}
public class CarBody
{
public void SetBody()
{
Console.WriteLine("CarBody - SetBody");
}
}
public class CarAccessories
{
public void SetAccessories()
{
Console.WriteLine("CarAccessories - SetAccessories");
}
}
public class CarFacade
{
CarModel model;
CarEngine engine;
CarBody body;
CarAccessories accessories;
public CarFacade()
{
model = new CarModel();
engine = new CarEngine();
body = new CarBody();
accessories = new CarAccessories();
}
public void CreateCompleteCar()
{
Console.WriteLine("**** Creating a Car ****");
model.SetModel();
engine.SetEngine();
body.SetBody();
accessories.SetAccessories();
Console.WriteLine("*** Car creation complete ***");
}
}
class Program
{
static void Main(string[] args)
{
CarFacade facade = new CarFacade();
facade.CreateCompleteCar();
}
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05741s using 14 queries.