Shaun Smith
unread,Aug 7, 2009, 7:29:56 PM8/7/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RobotLegs AS3
Hi Craig, I'm cross-posting your question to the RobotLegs Discussion
Group, just in case someone else finds the discussion useful:
"So I’m looking at the demos to help me get started using RobotLegs
and I am trying to figure out what the most recent/best approach is. I
see in the AcmeWidgetFactory startup command it binds the
AcmeWidgetFactory (i.e. the Application):
injector.bindValue( AcmeWidgetFactory, contextView );
However, in the “HelloFlex” demo it doesn’t do this. Just curious is
this needed, suggested, etc?"
The short answer: I'm not sure why I needed a strongly type reference
to the AcmeWidgetFactory - I can't seem to find anything that uses it;
I might have just needed it while sketching (before any refactoring).
In the default "mvcs" implementation of RobotLegs, all Command and
Mediator instances are given a reference to the contextView
responsible for their creation typed as a plain old
DisplayObjectContainer. In general you shouldn't need to know the
concrete type for this contextView. All you need to know is that it's
the top-level container for your context (not necessarily top-level in
terms of the whole application). There's nothing stopping you from
putting it into your IOC container strongly typed (as I did in the
AcmeWidgetFactory demo), but any Classes that depend directly on the
concrete type will become tightly coupled to it, and you'll lose
street cred.