有没有处理回调机制的设计模式? [英] Is there a design pattern that deals with callback mechanism?

查看:110
本文介绍了有没有处理回调机制的设计模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有处理回调机制的设计模式?

Is there a design pattern that deals with callback mechanism?

推荐答案

这将是观察者模式 - 维基百科

That would be the Observer Pattern - From Wikipedia


观察者模式(
异步发布/订阅
模式的子集)是一种软件设计模式
,其中一个名为
主题的对象维护其$ b的列表$ b的受抚养人,被称为观察者,
自动通知任何
状态更改,通常通过调用一个
的方法。它主要用于
实现分布式事件处理
系统。

The observer pattern (a subset of the asynchronous publish/subscribe pattern) is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems.

这篇关于有没有处理回调机制的设计模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆