@@ -4,28 +4,28 @@ class Program
44{
55 static void Main ( string [ ] args )
66 {
7- Console . WriteLine ( "=== Adapter Pattern === " ) ;
7+ Console . WriteLine ( "Adapter" ) ;
88 ExternalClass external = new ExternalClass ( ) ;
99 IInternal adapter = new Adapter ( external ) ;
1010 Console . WriteLine ( adapter . Fetch ( ) ) ;
1111
12- Console . WriteLine ( "\n === Decorator Pattern === " ) ;
12+ Console . WriteLine ( "\n Decorator " ) ;
1313 Coffee basic = new BasicCoffee ( ) ;
1414 Coffee milk = new MilkDecorator ( basic ) ;
1515 Coffee sugarMilk = new SugarDecorator ( milk ) ;
1616 Console . WriteLine ( $ "총 커피 가격: { sugarMilk . Cost ( ) } ") ;
1717
18- Console . WriteLine ( "\n === Facade Pattern === " ) ;
18+ Console . WriteLine ( "\n Facade " ) ;
1919 Computer computer = new Computer ( ) ;
2020 computer . Boot ( ) ;
2121
22- Console . WriteLine ( "\n === Factory Method Pattern === " ) ;
22+ Console . WriteLine ( "\n Factory Method" ) ;
2323 Animal dog = AnimalFactory . CreateAnimal ( "dog" ) ;
2424 Animal cat = AnimalFactory . CreateAnimal ( "cat" ) ;
2525 Console . WriteLine ( $ "Dog says: { dog ? . Speak ( ) } ") ;
2626 Console . WriteLine ( $ "Cat says: { cat ? . Speak ( ) } ") ;
2727
28- Console . WriteLine ( "\n === Method Chaining Pattern === " ) ;
28+ Console . WriteLine ( "\n Method Chaining" ) ;
2929 Calculator calc = new Calculator ( ) ;
3030 double result = calc . Add ( 10 ) . Subtract ( 2 ) . Multiply ( 3 ) . Divide ( 4 ) . GetResult ( ) ;
3131 Console . WriteLine ( $ "계산 결과: { result } ") ;
0 commit comments