One detail not mentioned explicitly but that is rather important:
Multiple message bus subscriptions can respond to the same message, so
you could have multiple separate actions take place as a result of
sending a message on the message bus.
HTH,
Gene
On Sun, 2009-11-15 at 08:48 -0800, panyasan wrote:
> Hi,
>
>
> sub wrote:
> >
> > I could use plain on events in qx objects with objects attaching
> > listeners.
> > I've also looked at the message bus framework - I'm a little confused as
> > to
> > what more does a message bus provide me.
> >
> > Can any one give a run down of how they differ?
> >
>
> the difference between an event and a message is that you dispatch events on
> the level of individual object, i.e. you have to know which object fires an
> event and attach a listener on this specific object.
>
> Messages, in contrast, are dispatched on one central message bus, i.e. the
> messages can be subscribed to at any time and they are available from
> everywhere in the code. The second difference is that you can listen for
> specific message names (such as "updateModels") or use a filter which
> captures all messages matching this filter:
>
> qx.event.message.Bus.getInstance().subscribe("update*",function(e){
> // this will capture "updateModel" and "updateLabel" etc.
> var data = e.getData();
> var name = e.getName(); // the name of the message
> alert([name,data]);
> },this);
>
> qx.event.message.Bus.getInstance().dispatch("updateModel","Foo!");
> qx.event.message.Bus.getInstance().dispatch("updateLabel","Bar!");
>
> HTH,
>
> Christian
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel