Coder Social home page Coder Social logo

jobserver's Introduction

简单理解观察者模式

观察者模式的命名习惯:

观察者:xxxObserver

被观察的目标:xxxSubject

实现步骤:

  • 步骤一:

    定义Observer对象,注意:定义的是接口,里面有个方法,习惯命名为update

  • 步骤二:

    定义实现Observer对象,他收到消息后,然后该干嘛就干嘛

  • 步骤三:

    定义目标Subject,他可以知道观察他的目标,并提供添加、删除、和通知更新的方法

  • 步骤四:

    定义具体目标对象

  • 步骤五:

    定义客户端测试

  • 步骤六:

    运行,验证结果

jobserver's People

Contributors

zzoson avatar

Watchers

James Cloos 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.