I don't necessarily agree here with Jesse; for me, a Command is most useful when it's an implementation of a single use-case, and when it executes in context, and handles it's results in context.  If there is functionality that is shared between commands, then I'd either move that functionality into a base command, or into a class that can be used by multiple commands.  I don't however, like the idea of coalescing multiple commands into one, or that the motivation for doing this being "having a lot of classes".
 
For those new to Cairngorm, I'd strongly advocate following the patterns as we've presented them, rather than commands switching their behavior as you describe here Jesse. 
 
Can you share a concrete example where you think there's valid reason to coalesce the commands ?
 
Steven
 
Steven Webster
Practice Director (Rich Internet Applications)
Adobe Consulting
Westpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UK
p: +44 (0) 131 338 6108
m: +44 (0) 7917 428 947 
[EMAIL PROTECTED]

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
Sent: 06 July 2006 16:08
To: [email protected]
Subject: Re: [flexcoders] Re: WebService & Cairngorm 2 Example

Naw. Commands aren't necessarely needing to be created that way. You
could, but for larger apps, you'd end up with a LOT of Commands. However,
it's not too tough to re-factor because if you coelecsed many Commands into
one, you'd really only need to change the Controller's addCommans function.

So, if you want to start that way, sure, go for it. For smaller projects,
it'll make it easier to identify what Command does what, and you won't have
to use custom responders in your Command's either if your Delegate only does
one thing.

For larger projects, however, you'll end up having many Commands doing
similiar things to similiar data; it's just easier to combine them in the
same class so related code is nearby for reference and/or sharing. Same
goes for Delegate's. A common strategy we've done is mapping our Delegate's
to CFC's; some of our CFC's, have say, 8 methods. 1 Delegate will have 8
public methods.

----- Original Message -----
From: "ben.clinkinbeard" <ben.clinkinbeard@gmail.com>
To: <[EMAIL PROTECTED]ups.com>
Sent: Thursday, July 06, 2006 10:37 AM
Subject: [flexcoders] Re: WebService & Cairngorm 2 Example

Very cool. That all makes pretty much sense. I do have another
question (shocking, huh?) about why you would have a single command
support multiple events/use multiple delegates. Isn't the point of
Commands to have a class that does one thing (and nothing else)?

Thanks again,
Ben

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to