Published by William B. Sanders on July 7, 2008 in ActionScript, Design Patterns, Flash, Flex, Mediator and OOP. This is Google
The Mediator design pattern is easy to understand but tricky to implement. At the core of the Mediator pattern is a Mediator class that coordinates a set of different requests that are sent by objects. The objects are called Colleagues. The Colleagues let the Mediator know that they want to change, and the Mediator handles the change taking into account what effect the changes will have on the other colleagues. For example, in my car when I turn on the headlights, the panel lights dim. Something in my car tells the panel lights to dim when the headlights are switched on. The headlights represent one colleague and the panel lights, another. A Mediator tells the panel lights to turn on as soon as I start the car, and then when the headlights are switched on, the Mediator tells the panel lights to dim. If I turn off the headlight, the Mediator tells the panel lights to brighten up again. The colleagues never communicate directly with one another but instead through the mediator. The idea is to reduce the complexity by handling all of the requests in one place. This also insures loose coupling between the colleagues.
The better approach is to create loosely-coupled custom components that are self contained, do not know about existence of each other and can communicate with external world by virtue of sending and receiving events. Adobe Flex is a good tool for creating event-driven applications, and it has all you need for creation of custom components. At this point, I could have just explained you the essence of using custom components, but I'd rather make this essay more solid by introducing a little bit of a theory of object-oriented programming and explain you the use of the design pattern called Mediator. People say that these days some smart employers are ask questions about design patterns during job interviews. So let's get armed with the pattern called Mediator. We'll start with a definition of this pattern from Wikipedia :
"The mediator pattern is a software design pattern that provides a unified interface to a set of interfaces in a subsystem."
To get started, the GoF present both a class and interactive diagram and we'll do the same here in Figure 1:
this is cite example [link]
t1 para Title
"q1 This is quote Maecenas id tellus quis justo commodo adipiscing. Integer a nulla sit amet lacus ultrices vehicula. Ut lacinia, velit in dictum blandit, erat quam placerat orci, ac nonummy est nisi pretium justo. Nunc pulvinar"[source]
p2 this is mixede1 content
e2 Thisp4 is mixede3 content and also new text dfsd fsdf sdfs dfsd fsd fsd fsdf sdf sdf sdf sdf sdf sdfsd
Warning: This is title of note:
This is quote within Noteanother text in the note

p3 This is mixed “q2 inline quote”txt and also new text




