1 / 13

디자인 패턴 연습 II

디자인 패턴 연습 II. 2008. 06. ㈜ 이포넷 수석보 조용국. Decorator. 객체를 감싸서 새로운 행동을 제공할 수 있다. component. component. operation(). Decorator.operation() addedBehavior(). Decorator in Starcraft. building. Decorator in Watrix Common DAO.

Download Presentation

디자인 패턴 연습 II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 디자인 패턴 연습 II 2008. 06. ㈜이포넷 수석보 조용국

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

  3. Decorator in Starcraft building

  4. Decorator in Watrix Common DAO Watrix Common DAO 에서 제공하는 ConnectionWrapper, StatementWrapper 는 DAO가 제공하는 기능과는 상관이 없고, 단순히 Connection 등을 재구성하려는 비슷한 요구가 있을때 편하라고 제공하는 서비스이지 DAO의 확장점은 아니다.

  5. Observer 상태가 변경되면 다른 객체들한테 연락을 돌린다. observer foreach in observers o.update(); subject return subjectState; observerState = subject.getState()

  6. Observer in Starcraft 패턴의 이름이 같다는 이유로 Observer 란 유닛과 CloakingUnit 을 예로 사용했지만, Observer패턴의 예로 삼기에는 써는 퀸의 패러사이트가 더 어울릴 것 같다.

  7. Observer in Watrix Common DAO listener provider event dcon dcon. getDaoConnectionProvider().notify…(event)

  8. FactoryMethod 생성할 구상 클래스를 서브 클래스에서 설정한다. Product = factoryMethod(); return new ConcreteProduct();

  9. FactoryMethod in Starcraft creator1 creator2 return creator.createUnit()

  10. FactoryMethod in Watrix Common DAO java.sql 패키지를 구성하는 대부분의 인터페이스는 거의 모두 FactoryMethod 패턴에 의해 구성된다. 덕분에 Oracle, MySQL 등 각각의 DBMS 와는 상관없이 java.sql 패키지로 Database 프로그래밍을 할 수 있는 것이다.

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

  12. AbstractFactory in Stracraft 스타크래프트의 건물에 내릴 수 있는 명령이 9개로 확정되어 있기 때문에 AbstractFactory 패턴만으로 효과가 있지만. 제품군의 가변성이 높다면 AbstractFactory 패턴 자체만으로는 효과적이지 않다.

  13. AbstractFactory in Stracraft 제품군이 여러 개가 아니라 하나일 수도 있고, 제품군별 제품을 생산하는 메쏘드가 여러개일 수도 있다 –조용국의 해석

More Related