[flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event
Where is the best place to put the static variable that stores the name of an event, in the class of this event (extends CairngormEvent) or in the class that extends FrontController and consumes this event? There are many examples with both ways... -- Fernando Ghisi
Re: [flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event
Don't know about best, but I always put it in the event class itself. I like that is results in the call to AddCommand having both the event class and the command class explicitly referenced as shown below. addCommand(GetSomeDataEvent.GET_SOME_DATA_EVENT, GetSomeDataCommand); hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com Fernando Ghisi wrote: Where is the best place to put the static variable that stores the name of an event, in the class of this event (extends CairngormEvent) or in the class that extends FrontController and consumes this event? There are many examples with both ways... -- Fernando Ghisi
Re: [flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event
Think MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP, Event.CHANGE, Event.RESIZE, FlexEvent.INITIALIZE, etc.. and there you have your answer :-) - Original Message - From: Fernando Ghisi [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Monday, February 25, 2008 2:37 PM Subject: [flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event Where is the best place to put the static variable that stores the name of an event, in the class of this event (extends CairngormEvent) or in the class that extends FrontController and consumes this event? There are many examples with both ways... -- Fernando Ghisi -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * 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] CairngormEvent - Place to put the static variable that stores the name of the event
I like this approaching too but, as a begginer with Cairngorm, when I see the basic examples (like http://www.cairngormdocs.org/tools/CairngormDiagramExplorer.html) putting this in the FrontController, I stay in doubt about if there is a pattern or a best way to do this. 2008/2/25, Scott Melby [EMAIL PROTECTED]: Don't know about best, but I always put it in the event class itself. I like that is results in the call to AddCommand having both the event class and the command class explicitly referenced as shown below. addCommand(GetSomeDataEvent.GET_SOME_DATA_EVENT, GetSomeDataCommand); hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com Fernando Ghisi wrote: Where is the best place to put the static variable that stores the name of an event, in the class of this event (extends CairngormEvent) or in the class that extends FrontController and consumes this event? There are many examples with both ways... -- Fernando Ghisi -- Fernando Benedet Ghisi
Re: [flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event
I always put the event name into the class - cairngorm event, or any event. I don't know why anyone wouldn't. This way around you can't have mismatched event class names (well not easily) and you have only one place to go to maintain your event. Paul - Original Message - From: Fernando Ghisi To: flexcoders@yahoogroups.com Sent: Monday, February 25, 2008 2:56 PM Subject: Re: [flexcoders] CairngormEvent - Place to put the static variable that stores the name of the event I like this approaching too but, as a begginer with Cairngorm, when I see the basic examples (like http://www.cairngormdocs.org/tools/CairngormDiagramExplorer.html) putting this in the FrontController, I stay in doubt about if there is a pattern or a best way to do this. 2008/2/25, Scott Melby [EMAIL PROTECTED]: Don't know about best, but I always put it in the event class itself. I like that is results in the call to AddCommand having both the event class and the command class explicitly referenced as shown below. addCommand(GetSomeDataEvent.GET_SOME_DATA_EVENT, GetSomeDataCommand); hth Scott Scott MelbyFounder, Fast Lane Software LLChttp://www.fastlanesw.com Fernando Ghisi wrote: Where is the best place to put the static variable that stores the name of an event, in the class of this event (extends CairngormEvent) or in the class that extends FrontController and consumes this event? There are many examples with both ways... -- Fernando Ghisi -- Fernando Benedet Ghisi