Decorator Component operation Decorator Concrete Component component operation

  • Slides: 13
Download presentation

Decorator 객체를 감싸서 새로운 행동을 제공할 수 있다. Component +operation() Decorator Concrete. Component component

Decorator 객체를 감싸서 새로운 행동을 제공할 수 있다. Component +operation() Decorator Concrete. Component component +operation() component. operation() Concrete. Decorator. A Concrete. Decorator. B added. State +operation() +added. Behavior() Decorator. operation() added. Behavior()

Decorator in Starcraft Building +command 1() +command 2() Hatchery Add. On. Building Command. Center

Decorator in Starcraft Building +command 1() +command 2() Hatchery Add. On. Building Command. Center building + command 1() + command 2() Lair +command 1() +command 2() Commsat. Station. Command. Center +command 1() +command 2()

Decorator in Watrix Common DAO java. sql. Connection java. sql. Statement +operation() JDBC Connection

Decorator in Watrix Common DAO java. sql. Connection java. sql. Statement +operation() JDBC Connection +operation() Connection. Wrapper JDBC Statement connection +operation() Dao. Connection +create. Connection() +operation() Statement. Wrapper statement +operation() Dao. Statement +execute. Query() +operation() Watrix Common DAO 에서 제공하는 Connection. Wrapper, Statement. Wrapper 는 DAO가 제공하는 기능과는 상관이 없고, 단순히 Connection 등을 재구성하려는 비슷한 요구가 있을때 편하라고 제공하는 서비스이지 DAO의 확장점은 아니다.

Observer 상태가 변경되면 다른 객체들한테 연락을 돌린다. Subject observer +attach(in observer) +detach(in observer) +notify()

Observer 상태가 변경되면 다른 객체들한테 연락을 돌린다. Subject observer +attach(in observer) +detach(in observer) +notify() Observer +update() foreach in observers o. update(); Concrete. Subject subject. State Concrete. Observer subject observer. State +get. State() +update() return subject. State; observer. State = subject. get. State()

Observer in Starcraft 패턴의 이름이 같다는 이유로 Observer 란 유닛과 Cloaking. Unit 을 예로

Observer in Starcraft 패턴의 이름이 같다는 이유로 Observer 란 유닛과 Cloaking. Unit 을 예로 사용했지만, Observer패턴의 예로 삼기에는 써는 퀸의 패러사이트가 더 어울릴 것 같다. Cloaking. Unit +attach(in Detector) +detach(in Detector) +notify. Detectors(in state) Dark. Templer +execute(in state) Detector +update(in state) Observer +detect(in state)

Observer in Watrix Common DAO Statement. Listenerable +add. Statement. Listener(in listener) +remove. Statement. Listener(in

Observer in Watrix Common DAO Statement. Listenerable +add. Statement. Listener(in listener) +remove. Statement. Listener(in listener) +notify. Before. Execute(in event) +notify. After. Execute(in event) +notify. Throw. SQLException(in event) listener Statement. Listener +before. Execute(in event) +after. Exceute(in event) +throw. SQLException(in event) Console. Statement. Listener Log 4 j. Listener Dao. Connection. Provider +get. Dao. Connection() Dao. Connection provider event provider +create. Statement() +get. Dao. Connection. Provider() dcon +before. Execute(in event) +after. Exceute(in event) +throw. SQLException(in event) +operations()… Dao. Statement dcon +create. Statement. Listener. Event() +execute. Query()… dcon. get. Dao. Connection. Provider(). notify…(event) Statement. Listener. Event +get. Sql() +get. Start. Time() +get. End. Time() +get. Elapsed. Time()

Factory. Method 생성할 구상 클래스를 서브 클래스에서 설정한다. Product Creator +factory. Method() Product =

Factory. Method 생성할 구상 클래스를 서브 클래스에서 설정한다. Product Creator +factory. Method() Product = factory. Method(); Concrete. Product Concrete. Creator +factory. Method() return new Concrete. Product();

Factory. Method in Starcraft Unit Creator creator 1 creator 2 +create. Unit() Factory Siege.

Factory. Method in Starcraft Unit Creator creator 1 creator 2 +create. Unit() Factory Siege. Tank. Creator +create. Unit() Vulture creator 1 creator 2 +create. Unit 1() +create. Unit 2() Vulture. Creator return creator. create. Unit() +create. Unit()

Factory. Method in Watrix Common DAO java. sql 패키지를 구성하는 대부분의 인터페이스는 거의 모두

Factory. Method in Watrix Common DAO java. sql 패키지를 구성하는 대부분의 인터페이스는 거의 모두 Factory. Method 패턴에 의해 구성된다. 덕분에 Oracle, My. SQL 등 각각의 DBMS 와는 상관없이 java. sql 패키지로 Database 프로그래밍을 할 수 있는 것이다. java. sql. Statement +execute. Query() Dao. Statement +execute. Query() java. sql. Connection +create. Statement() Dao. Connection. Provider +get. Connection() +connect() Jdbc. Connection. Provider +connect() +operation() Jndi. Connection. Provider +connect() +operation()

Abstract. Factory 구상 클래스를 지정하지 않으면서도 일군의 객체를 생성할 수 있게 해준다. Abstract. Product.

Abstract. Factory 구상 클래스를 지정하지 않으면서도 일군의 객체를 생성할 수 있게 해준다. Abstract. Product. A Abstract. Factory +create. Product. A() +create. Product. B() Concrete. Product. A 1 Concrete. Product. A 2 Concrete. Factory 1 +create. Product. A() +create. Product. B() Abstract. Product. B Concrete. Product. B 1 Concrete. Product. B 2 Concrete. Factory 2 +create. Product. A() +create. Product. B()

Abstract. Factory in Stracraft 스타크래프트의 건물에 내릴 수 있는 명령이 9개로 확정되어 있기 때문에

Abstract. Factory in Stracraft 스타크래프트의 건물에 내릴 수 있는 명령이 9개로 확정되어 있기 때문에 Abstract. Factory 패턴만으로 효과가 있지만. 제품군의 가변성이 높다면 Abstract. Factory 패턴 자체만으로는 효과적이지 않다. Battle. Unit Building +command 1() +command 2() Zealot Marine Gateway +command 1() +command 2() Wizard. Unit High. Templer Barrack +command 1() +command 2() Medic

Abstract. Factory in Stracraft 제품군이 여러 개가 아니라 하나일 수도 있고, 제품군별 제품을 생산하는

Abstract. Factory in Stracraft 제품군이 여러 개가 아니라 하나일 수도 있고, 제품군별 제품을 생산하는 메쏘드가 여러개일 수도 있다 – 조용국의 해석 Unit Building +command 1() +command 2() Siege. Tank Marine Factory +command 1() +command 2() Barrack +command 1() +command 2() Vulture Medic