Giter VIP home page Giter VIP logo

design-pattern's Introduction

Design Pattern

Chap01

Duck Class

  • FlyBehavior Interface

image

  • QuackBehavior Interface

image

  • Duck Class

image

전략 패턴

전략 패턴은 알고리즘 군을 정의하고 캡슐화해서 각각의 알고리즘군을 수정해서 사용할 수 있게 해 줍니다. 전략 패턴을 사용하면 클라이언트로부터 알고리즘을 분리해서 독립적으로 변경할 수 있습니다

Chap02

  • Subject Interface

image

  • Observer Interface

image

옵저버 패턴

한 객체의 상태(Subject)가 변화하면 그 객체에 의존하는 다른 객체(Observer)에게 연락이 가고 자동으로 갱신되는 일대다(Many-to-One) 의존성을 정의합니다.

  • subject는 observer들이 Observer 인터페이스를 구현한다는 것을 제외하면 observer에 관련해서 아는 것이 없습니다. 그래서 느슨한 결합 입니다. 느슨한 결합을 사용하면, 훨씬 더 유연하고 변화에 강합니다.
  • Observer Pattern은 subject가 observer에게 데이터를 보내는 방식(Push), observer가 데이터를 가져오는 방식(Pull)이 있습니다.

design-pattern's People

Contributors

rldnrl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.