floater
Java Jedi
总版主
发贴: 3233
积分: 421
|
于 2004-12-03 23:31
mediator is just a way to loosely couple the actions in a structure of objects. It makes the actions relatively invariant to the change of the structure of objects. For example, due to the need of layouts, we may put a button in a panel, or put a button in a panel within another panel. So mediators concern only the button, or the like, not the panels(mainly for layout purpose). It consolidates the actions too.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler, Refactoring - Improving the Design of Existing Code
|