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

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

问题描述

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

Is there a design pattern that deals with callback mechanism?

推荐答案

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

That would be the Observer Pattern - From Wikipedia


观察者模式(
异步发布/订阅
模式的子集)是一个软件设计模式
,其中一个称为
主题的对象维护着一个
依赖者,称为观察者,
通常通过调用其方法中的一个
来自动通知任何
状态变化。它主要用于
实现分布式事件处理
系统。

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天全站免登陆