| when a user logs in. If your UserVO represents the currently logged-in
user, then I would 
| store it in the ModelLocator since it is extremely convenient. Otherwise
(if you're 
| editing someone else's UserVO), I would pass it to the controller.

Todd makes good sense here ... if I could elaborate on when to use the 
ModelLocator, I would think of a VO as either being "state" or "transient".

Transient data is that data that "comes and goes" during the lifetime
of your application; for instance you want to construct an EmailVO
solely for the purposes of calling the "SendPasswordReminder" command
(by way of convoluted example) then I'd create that EmailVO wherever
I'm broadcasting the "sendPasswordReminder" event - it's a transient
Value Object that only need exist for the lifetime of that use-case
being executed.

If however, the value object I'm creating can be considered application
state - something that dictates the current behavior/appearance of the
application, then I'd add it to the ModelLocator.  So - to use Todd's
example, if you want to store the "currently logged in user", you may
choose to attach an instance ("loggedInUser") of UserVO to the model
locator.

Bad Cairngorm Code Smell: The Fat View Helper.  We consistently see
people using the View Helper as the "catch all for business logic"
when it doesn't feel like business logic that belongs in a Command
or Business Delegate.  Don't forget that Cairngorm is the skeleton
of your application, but that the creation of flesh and muscle and
fur and feathers depends on the nature of the beast that you're 
building.   So adhere to good OO, create rich hierarchies of classes
that help you describe your business domain, and use these classes
from your Command classes and Business Delegates.  Make sure you
have LoanCalculator.as, ShoppingBasket.as, and all other manner of
classes that describe the business domain that you are operating in.

View Helpers manipulate the model to present it for the view.

Best,

Steven

--
Steven Webster
Technical Director
iteration::two
 
This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.
 
Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.



 
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:
    http://docs.yahoo.com/info/terms/
 



Reply via email to