I had a talk with Aral after MXDU, was interesting to compare his approach with view helpers. It increases the encapsulation of views, but on the face of it seems to reduce the isolation that a view helper introduces between the commands and the view. It also becomes more important to bubble UI events to the right level in the views to broadcast the event to the command, otherwise the command won't have reference to a view that provides the necessary methods to carry out the command's view update requirements.
It should be added that when Aral uses ARP with Flex he never puts code in the mxml, as you would with a flash view he keeps his UI code in a class file for each view - so the exact skin of the view can be modified independently of the code. To my mind that's a little excessive - expressions in bindings are to me are a key part of Flex's RAD value proposition.
I'm thinking of trying out ARP style views with Cairngom (that would make it "Carp"?) to get more of a handle on the pros/cons of the two approaches.
Cheers,
Robin
On 23/02/2005, at 6:25 AM, Mehdi, Agha wrote:
Yeah, you can do that.
�
EventBroadcaster.getInstance().broadcastEvent( "myCommand", this�);
�
Why would you do it that way though? You can register a view with its viewHelper and than your command can use ViewLocator to get that helper that talks to your view. I don't think having your commands know about your views is a very good idea. Unless of course you have specific reasons.
From: Clint Tredway [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 8:38 AM
To: [email protected]
Subject: [flexcoders] passing a view to a command
I am using Cairngorm and I am wondering if I can pass a view to a command dynamically?
Yahoo! Groups Links
� To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
�
� To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
�
� Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----
This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
To reply to our email administrator directly, send an email to
[EMAIL PROTECTED]
Littler Mendelson, P.C.
http://www.littler.com

