+ -
当前位置:首页 → 问答吧 → 9->The Observer Pattern(ses513ses预定)

9->The Observer Pattern(ses513ses预定)

时间:2006-03-27

来源:互联网

9
The Observer
Pattern
PART OF THE EXPRESSIVENESS OF OBJECT-ORIENTED PROGRAMMING is the ability to build
complex networks of interconnections between objects. Linked together, objects can exchange
services and information.
Often, you want objects to “chatter” when the state of an object changes. But for many reasons,
you may prefer to not “hard code” the lines of communications. Perhaps you want to form and reform
connections to respond to conditions in your application or perhaps you simply want to refactor the
communication code to avoid interdependencies between classes.
The Problem
How can you alert (potentially) many objects when a certain object’s state changes? Is there a scheme
that’s dynamic―one that allows interconnections to come and go as a script executes?
The Solution
The Observer pattern allows objects to express interest in the state of another object and provides a

作者: PHPChina   发布时间: 2006-03-26

...

作者: Bantu   发布时间: 2006-03-28

这章我要了.不过本人水平有限,如果翻译得不好大家不要笑.

作者: ses513ses   发布时间: 2006-03-28

欢迎加入!

作者: PHPChina   发布时间: 2006-03-28

热门下载

更多