ubervu
Apple iPhone
Nexus One
+ Add

EMAIL ALERTS: SUBSCRIBE
Updated 3 months, 3 weeks ago

Source:
http://www.gridlinked.info/
Eyu, you have made an excellent an astute point. True, callbacks is a 1-to-1 connection between the request originator and the response. If you have a need for multiple callbacks (e.g. more than 1 listener wants to be notified), then use either the ModelLocator databinding approach OR you can create a special dispatcher that supports originators to register for events… think of this an “event bus/pipeline” for your special needs. Unfortunately event bus architectures are ALWAYS ...
Showing 12 relevant reactions out of 16.
Cairngorm Secret Tip #3: Responders for View Notifications http://bit.ly/85oCFr //Excelente! #Flex #Cairngorm
Eyu, you have made an excellent an astute point. True, callbacks is a 1-to-1 connection between the request originator and the response. If you have a need for multiple callbacks (e.g. more than 1 listener wants to be notified), then use either the ModelLocator databinding approach OR you can create a special dispatcher that supports originators to register for events… think of this an “event ... See all content
Databinding is certainly cleaner than callbacks. However, if you have a single view/component instance that wants specific data (without databinding triggers to other instances), then callbacks is probably the cleanest solution. Remember that logic in presentation models works great. Heavy-loading logic in presentation components is not recommended. Instead create facade or delegate classes to manage ... See all content
Remember that your command MUST call super.execute(event) in order to cache any callbacks to views.
e.g.
override public function execute(event:CairngormEvent):void {
super.execute(event);
switch(event.type) {
…
}
}
AND your response handlers must in turn always invoke a notifyCaller() to notify view or other originating
...
See all content
Note that dependency injectors are already available in the Mate MVC. And… best of all, you can use the Mate EventMaps with Cairngorm. So the Mate EventMap will only have dependency injectors [MateDI] (no event handlers) AND Cairngorm has the event handlers. This is an excellent blend because MateDI supports injection into any specified class instance regardless of position in the view hierarchy ... See all content
Great article.
This saves the new “notify-view” event generation/dispatch from the command to the view.
Now we have a use case that several views are listening to the “notify-view” event generated by the command. But in your example, it seems only one callback responder can be specified in the original event. Can you suggest a way to resolve our issue?
Thanks!

#cairngorm, heres a great article on using IResponder to pass view notifications http://bit.ly/2Keuls
Love the article, but it would be nice to see what the command class looks like, or at least a link to an example.
If I am understanding this correctly, since the responder is optional on the event, the command class would have to check to see if it is defined before calling it to avoid a null pointer exception correct?
So would a command result function notifying a view responder
...
See all content
Follow us
FEEDBACKTwitterFacebook