Thanks, 

 

This clarifies issue quite nicely for me. 

 

 

Tero

 

   _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of mssairam
Sent: 22 May 2007 14:59
To: [email protected]
Subject: [flexcoders] Re: Cairngorm event question.

 

Hi,

Really you just need to have a LoginEvent, I think. 

Here is a sequence of the scenario -- 

1) User enters username and password and clicks submit
2) A Cairngorm event named "LoginEvent" is broadcast probably with 
data elements containing username and password as entered by user
3) The Cairngorm controller has a mapping for "LoginEvent"-. The 
controller uses this mapping and figures out the class that handles 
this event -- lets say a class called "LoginCommand"
4) LoginCommand class should have a method declared -- 
public function execute( event : CairngormEvent ): void
The event is passed to this method and this method effectively makes 
a call to the server. Typically this is done through a Delegate 
class. This is an asynchronous call so the "execute" method doesnt 
really wait for the response.
5) The same LoginCommand class should have a method that looks like 
this ...
public function onResult( event : * = null ) : void
When the server comes back with results after processing, this 
method receives the response back and processes it.
6) However if some error occurs, the handling is done by another 
method --
public function onError( event : * = null ) : void
7) In the onResult and onError methods, the information from the 
server is used to update the display. Typically this is done by 
updating the "Model" with the newly acquired information and the 
view updates itself by a previously specified databinding mechanism.

I am not an expert on Cairngorm -- hope this helps.

thanks

--- In HYPERLINK
"mailto:flexcoders%40yahoogroups.com"[EMAIL PROTECTED], "Tero
Pikala" <[EMAIL PROTECTED]> wrote:
>
> Hi 
> 
> 
> 
> I'm designing my first Cairngorm application and would like to 
have opinions
> about events to create. 
> 
> 
> 
> I will definitely have LoginEvent which takes place after user has 
entered
> credentials and clicked "Login" button. 
> 
> 
> 
> Should I also create events like LoginSuccessfulEven-t, 
LoginFailedEvent and
> PasswordExpiredEven-t which would happen in result to a server 
response? 
> 
> 
> 
> I think I should but this being my first project I'm not sure 
about it and
> would like to have some feedback from the experts. 
> 
> 
> 
> Thanks 
> 
> 
> 
> 
> 
> 
> 
> Tero 
> 
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.7.6/813 - Release Date: 
20/05/2007
> 07:54
> 
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.467 / Virus Database: 269.7.6/813 - Release Date: 
20/05/2007
> 07:54
>

 


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.6/813 - Release Date: 20/05/2007
07:54



No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 21/05/2007
14:01
 

Reply via email to