RE: [flexcoders] Re: Cairngorm and popup window design question

2005-06-15 Thread Steven Webster
| 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/
 





RE: [flexcoders] Re: Cairngorm and popup window design question

2005-06-14 Thread Steven Webster





Why not store the object that you wish available to 
multiple aspects of your application,
on the ModelLocator ?  
 
Steven
 


--
Steven WebsterTechnical 
Director
iteration::two[EMAIL PROTECTED]
 
Office:  +44 (0)131 338 
6108Mobile: +44 (0)7977 216 223
 
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.
 


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Shlomi 
CohenSent: 14 June 2005 20:52To: 
'flexcoders@yahoogroups.com'Subject: RE: [flexcoders] Re: Cairngorm 
and popup window design question

Hi
 
yes 
you are right , and i shorten the calls for simplicity. the question is how 
the the userVO object is shared among all those 
View--Helper--Control--Delegate
 
i 
understand that the helper pass it on but where is it best to define it , on the 
helper ? or the view ??
 
 
thanks
 
Shlomi


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
charged2885Sent: Tuesday, June 14, 2005 10:34 PMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] Re: Cairngorm and 
popup window design question
disclaimer: i'm new to actionscript and caingorm so i could be 
mistaken.From what I understand, you should not be accessing any 
services from the viewhelper. Broadcast a FrontController.SAVE_USER event 
with the UserVO as data inside the viewhelper instead. this should invoke 
the SaveUserCommand which calls your AccountDelegate's saveUser method which 
calls the service's saveUser.Todd BolandCharged Software--- 
In flexcoders@yahoogroups.com, Shlomi Cohen <[EMAIL PROTECTED]> wrote:> 
Hi>  > This is a design question using the cairngorm 
framework .>  > How is it best to implement the design 
pattern (MVC) proposed by the> framework , regarding object passed from a 
window to a popup window , > considering that this object needs to be 
accessed both in the View and> ViewHelper>  > for 
example: you have the CreateUser.mxml and the 
CreateUserViewHelper.as>  > --here is CreateUser.mxml 
>  > .>  
> 
public var userVO:UserVO; //  this is set by the calling 
window>  
> 
>  
>  
> 
> 
width="200"/>> 
>    
> 
direction="horizontal">> 
> text="{userVO.loginName}" 
width="200"/>> 
> 
>  > --- here is 
CreateUserViewHelper.as>  > class 
CreateUserViewHelper.as{> 
> function 
saveUser(){> 
service.saveUser(view.userVO);  // is this the best way or for this> 
class to hold it ???> 
> }>  >   > 
}>  > Thanks >  > Shlomi>  
>  > > > 
__> 
This email has been scanned by the MessageLabs Email Security System.> 
For more information please visit http://www.messagelabs.com/email 
> 
This 
email has been scanned by the MessageLabs Email Security System.For more 
information please visit http://www.messagelabs.com/email 
This 
email has been scanned by the MessageLabs Email Security System.For more 
information please visit http://www.messagelabs.com/email 
__







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.










RE: [flexcoders] Re: Cairngorm and popup window design question

2005-06-14 Thread Shlomi Cohen





Hi
 
yes 
you are right , and i shorten the calls for simplicity. the question is how 
the the userVO object is shared among all those 
View--Helper--Control--Delegate
 
i 
understand that the helper pass it on but where is it best to define it , on the 
helper ? or the view ??
 
 
thanks
 
Shlomi


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
charged2885Sent: Tuesday, June 14, 2005 10:34 PMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] Re: Cairngorm and 
popup window design question
disclaimer: i'm new to actionscript and caingorm so i could be 
mistaken.From what I understand, you should not be accessing any 
services from the viewhelper. Broadcast a FrontController.SAVE_USER event 
with the UserVO as data inside the viewhelper instead. this should invoke 
the SaveUserCommand which calls your AccountDelegate's saveUser method which 
calls the service's saveUser.Todd BolandCharged Software--- 
In flexcoders@yahoogroups.com, Shlomi Cohen <[EMAIL PROTECTED]> wrote:> 
Hi>  > This is a design question using the cairngorm 
framework .>  > How is it best to implement the design 
pattern (MVC) proposed by the> framework , regarding object passed from a 
window to a popup window , > considering that this object needs to be 
accessed both in the View and> ViewHelper>  > for 
example: you have the CreateUser.mxml and the 
CreateUserViewHelper.as>  > --here is CreateUser.mxml 
>  > .>  
> 
public var userVO:UserVO; //  this is set by the calling 
window>  
> 
>  
>  
> 
> 
width="200"/>> 
>    
> 
direction="horizontal">> 
> text="{userVO.loginName}" 
width="200"/>> 
> 
>  > --- here is 
CreateUserViewHelper.as>  > class 
CreateUserViewHelper.as{> 
> function 
saveUser(){> 
service.saveUser(view.userVO);  // is this the best way or for this> 
class to hold it ???> 
> }>  >   > 
}>  > Thanks >  > Shlomi>  
>  > > > 
__> 
This email has been scanned by the MessageLabs Email Security System.> 
For more information please visit http://www.messagelabs.com/email 
> 
This 
email has been scanned by the MessageLabs Email Security System.For more 
information please visit http://www.messagelabs.com/email 
__

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__








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.