File tree 14 files changed +305
-243
lines changed
14 files changed +305
-243
lines changed Original file line number Diff line number Diff line change 42
42
<Reference Include =" System.Xml" />
43
43
</ItemGroup >
44
44
<ItemGroup >
45
- <Compile Include =" Program.RealWorld.cs" />
46
- <Compile Include =" Program.Structural.cs" />
45
+ <Compile Include =" RealWorld\CarBuilder.cs" />
46
+ <Compile Include =" RealWorld\IVehicleBuilder.cs" />
47
+ <Compile Include =" RealWorld\MotorCycleBuilder.cs" />
48
+ <Compile Include =" RealWorld\Program.cs" />
49
+ <Compile Include =" RealWorld\ScooterBuilder.cs" />
50
+ <Compile Include =" RealWorld\Shop.cs" />
51
+ <Compile Include =" RealWorld\Vehicle.cs" />
52
+ <Compile Include =" Structural\Program.Structural.cs" />
47
53
<Compile Include =" Properties\AssemblyInfo.cs" />
48
54
</ItemGroup >
49
55
<ItemGroup >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ /// <summary>
3
+ /// Separates object construction from its representation.
4
+ ///
5
+ /// Separate the construction of a complex object from its representation so that
6
+ /// the same construction process can create different representations.
7
+ ///
8
+ /// Frequence of use: 2 medium low.
9
+ /// </summary>
10
+ namespace DoFactory . GangOfFour . Builder . RealWorld
11
+ {
12
+ /// <summary>
13
+ /// The 'ConcreteBuilder2' class
14
+ /// </summary>
15
+ class CarBuilder : IVehicleBuilder
16
+ {
17
+ public Vehicle Vehicle { get ; }
18
+
19
+ public CarBuilder ( )
20
+ {
21
+ Vehicle = new Vehicle ( "Car" ) ;
22
+ }
23
+
24
+ public void BuildFrame ( )
25
+ {
26
+ Vehicle [ "frame" ] = "Car Frame" ;
27
+ }
28
+
29
+ public void BuildEngine ( )
30
+ {
31
+ Vehicle [ "engine" ] = "2500 cc" ;
32
+ }
33
+
34
+ public void BuildWheels ( )
35
+ {
36
+ Vehicle [ "wheels" ] = "4" ;
37
+ }
38
+
39
+ public void BuildDoors ( )
40
+ {
41
+ Vehicle [ "doors" ] = "4" ;
42
+ }
43
+ }
44
+ }
Original file line number Diff line number Diff line change
1
+ namespace DoFactory . GangOfFour . Builder . RealWorld
2
+ {
3
+ interface IVehicleBuilder
4
+ {
5
+ Vehicle Vehicle { get ; }
6
+
7
+ void BuildDoors ( ) ;
8
+ void BuildEngine ( ) ;
9
+ void BuildFrame ( ) ;
10
+ void BuildWheels ( ) ;
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ /// <summary>
3
+ /// Separates object construction from its representation.
4
+ ///
5
+ /// Separate the construction of a complex object from its representation so that
6
+ /// the same construction process can create different representations.
7
+ ///
8
+ /// Frequence of use: 2 medium low.
9
+ /// </summary>
10
+ namespace DoFactory . GangOfFour . Builder . RealWorld
11
+ {
12
+ /// <summary>
13
+ /// The 'ConcreteBuilder1' class
14
+ /// </summary>
15
+ class MotorCycleBuilder : IVehicleBuilder
16
+ {
17
+ public Vehicle Vehicle { get ; }
18
+
19
+ public MotorCycleBuilder ( )
20
+ {
21
+ Vehicle = new Vehicle ( "MotorCycle" ) ;
22
+ }
23
+
24
+ public void BuildFrame ( )
25
+ {
26
+ Vehicle [ "frame" ] = "MotorCycle Frame" ;
27
+ }
28
+
29
+ public void BuildEngine ( )
30
+ {
31
+ Vehicle [ "engine" ] = "500 cc" ;
32
+ }
33
+
34
+ public void BuildWheels ( )
35
+ {
36
+ Vehicle [ "wheels" ] = "2" ;
37
+ }
38
+
39
+ public void BuildDoors ( )
40
+ {
41
+ Vehicle [ "doors" ] = "0" ;
42
+ }
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments