tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/26-just-looking-to-see-if-im-on-the-right-trackRobotlegs: Discussion 2018-10-18T16:35:07Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/7299102009-12-16T15:24:42Z2009-12-16T15:24:42ZJust looking to see if I'm on the right track...<div><p>I didn't run it, but I took a look at the code, and I think
you're definitely on the right track.</p>
<p>My only comments would be:<br>
1 - It's very clean and neat.<br>
2 - In you're context you don't need to provide the constructor.
Not really a critique. I just thought it might as well not be
there.. That is unless you are switching the auto startup property
occasionally.<br>
3 - You could omit the entire startup command/event sequence and
just do your mappings in the context's startup command, but I like
you're technique :)</p>
<p>Looks good to me!<br></p></div>levi.stropetag:robotlegs.tenderapp.com,2009-10-18:Comment/7299102009-12-16T15:30:02Z2009-12-16T15:30:03ZJust looking to see if I'm on the right track...<div><p>If you don't provide the constructor in the context you get a
compile time error:</p>
<p>Error: Incorrect number of arguments. Expected 0.</p>
<p>Thanks for the comments.</p></div>mdw1980tag:robotlegs.tenderapp.com,2009-10-18:Comment/7299102009-12-16T15:56:34Z2009-12-16T15:56:34ZJust looking to see if I'm on the right track...<div><p>This runs for me. What version of the framework are you
using?</p>
<pre>
<code>// Imports have been cut out for brevity
package com.mailsettings.contexts
{
public class MailModuleContext extends Context
{
override public function startup():void
{
//model
injector.mapSingleton(MailSettingsModel);
//View
mediatorMap.mapView(contextView, MailModuleMediator, MailSettingsModule);
//Controllers
commandMap.mapEvent(DomainEmailEvent.QUERY_DOMAIN_EMAIL, QueryDomainEmailCommand);
commandMap.mapEvent(EmailAccountEvent.ADD_EMAIL_ACCOUNT, AddEmailAccountCommand);
commandMap.mapEvent(EmailAccountEvent.EDIT_EMAIL_ACCOUNT, EditEmailAccountCommand);
commandMap.mapEvent(EmailAccountEvent.DELETE_EMAIL_ACCOUNT, DeleteEmailAccountCommand);
//services
injector.mapSingletonOf(IEmailService, EmailService);
}
}
}</code>
</pre></div>levi.stropetag:robotlegs.tenderapp.com,2009-10-18:Comment/7299102009-12-16T16:06:28Z2009-12-16T16:06:30ZJust looking to see if I'm on the right track...<div><p>Odd. I'm using 1.0.1 as seen by the swc file in the lib
folder.</p></div>mdw1980tag:robotlegs.tenderapp.com,2009-10-18:Comment/7299102009-12-29T19:22:51Z2010-01-02T13:01:55ZJust looking to see if I'm on the right track...<div><p>I took a look at your code and it's nice and clean, good
work.</p>
<p>@levi I always leave the constructor on my context, but that's
because of my laziness to delete it. Don't know why you shouldn't
have it, it's not getting in the way. Also, yeah, i like to do my
mappings in the context and skip the whole startup command/event
thing.</p></div>Andrei TT