From 9847fd279214c5aebd9abb4b42e4a253bb3dbb79 Mon Sep 17 00:00:00 2001 From: soyeon207 Date: Wed, 9 Jun 2021 01:49:37 +0900 Subject: [PATCH] =?UTF-8?q?#6=20=EB=B8=8C=EB=A6=BF=EC=A7=80=20=ED=8C=A8?= =?UTF-8?q?=ED=84=B4=20=EC=98=88=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/2021-04-24-bridge-pattern.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_posts/2021-04-24-bridge-pattern.md b/_posts/2021-04-24-bridge-pattern.md index ffa81ea..ad423d6 100644 --- a/_posts/2021-04-24-bridge-pattern.md +++ b/_posts/2021-04-24-bridge-pattern.md @@ -21,7 +21,7 @@ tags: [디자인패턴, 브리지패턴, 구조패턴] **Implementor : 기능 구현을 위한 인터페이스** ```Java -public interface MakeHandler() { +public interface MakeHandler { public void prepareIngredient(); public void stuffingIngredient(); } @@ -29,7 +29,7 @@ public interface MakeHandler() { **ConcreteImplementor : 실제 기능 구현** ```Java -public class PotatoHotdogMethod() implements MakeHandler { +public class PotatoHotdogMethod implements MakeHandler { public void prepareIngredient() { System.out.println("감자 준비"); } @@ -39,7 +39,7 @@ public class PotatoHotdogMethod() implements MakeHandler { } } -public class CheeseHotdogMethod() implements MakeHandler { +public class CheeseHotdogMethod implements MakeHandler { public void prepareIngredient() { System.out.println("치즈 준비"); } @@ -52,7 +52,7 @@ public class CheeseHotdogMethod() implements MakeHandler { **Abstraction : 기능 계층의 최상위 클래스** ```Java -public abstract class HotDog() { +public abstract class HotDog { private MakeHandler makeHandler; public HotDog(MakeHandler makeHandler) { @@ -60,11 +60,11 @@ public abstract class HotDog() { } public void prepareIngredient() { - makeHandler.prepareIngredient; + makeHandler.prepareIngredient(); } public void stuffingIngredient() { - makeHandler.stuffingIngredient; + makeHandler.stuffingIngredient(); } public abstract void fry(); @@ -99,9 +99,9 @@ public class CheeseHotDog extends HotDog { ```Java public class Main { - public static void Main(String args[]) { + public static void main(String args[]) { HotDog cheeseHotDog = new CheeseHotDog(new CheeseHotdogMethod()); - HotDog potatoHotDog = new PotatoHotDog(new PotatoHotDogMethod()); + HotDog potatoHotDog = new PotatoHotDog(new PotatoHotdogMethod()); cheeseHotDog.fry(); cheeseHotDog.prepareIngredient(); cheeseHotDog.stuffingIngredient();