tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/586-injecting-model-into-mediatorRobotlegs: Discussion 2018-10-18T16:35:40Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T11:24:35Z2012-05-31T11:24:35Zinjecting model into mediator <div><p>I'm assuming that when you say "model is generally available
freely within all framework actors" that</p>
<p>1) by 'freely available' you mean that you can access it via a
static or global (neither of which is 'free' but that's a bigger
story)</p>
<p>2) that you have a mental concept of 'a model' as a single thing
for the app, as opposed to a domain of objects holding state and
logic...</p>
<p>Neither of these concepts fits what Robotlegs is about - in
fact, Robotlegs is designed to be the cure for both of these
concepts, which are really problems in their own right, and not
solutions :)</p>
<p>If you do some general reading around on Robotlegs you'll find
that things are done a bit differently - I'd start with the basic
best practices documentation.</p>
<p>To answer the question directly: if you omit the [Inject] the
statsModel will be null.</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T11:52:21Z2012-05-31T11:52:21Zinjecting model into mediator <div><p>Yeah i tried to read and go through best practices, but frankly,
right now, it's a bit hard for me to understand many of the
terminologies there. However i have grasped some of it and still
struggling...<br>
By freely means, I don't need to use anything like [Inject] in
those framework ( talking about puremvc actually).</p>
<p>btw, Which are the classes that i need to prefix with [Inject]
.<br>
All classes ?<br>
Particular Classes only ? What are they ?<br>
Or only those classes that need [Inject].</p>
<p>V.</p></div>vishwas.gagranitag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T11:58:38Z2012-05-31T11:58:38Zinjecting model into mediator <div><p>Hello,</p>
<p>actually you should use [Inject] for those things which are
mapped for injection. In your context (normally) you are saying to
RobotLegs what you want to inject/use inside your classes, i.e. you
are defining rules. Then by placing [Inject] in front of the
variable definition you saying to RobotLegs to check your rules and
to populate that variable with data (usually an instance of the
mapped class).</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T12:59:47Z2012-05-31T12:59:47Zinjecting model into mediator <div><p>Is this a MUST for whatever classes (ie. not just framework
actors ) i need to use inside my "xyzMediator".<br>
ie, any type of class instance i need to use , i MUST do this :<br>
1) map for injection inside context<br>
2) use [Inject] and then define the class</p>
<p>Is their any example of class, that might not use [Inject]
before it ?</p>
<p>V.</p></div>vishwas.gagranitag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T13:02:14Z2012-05-31T13:02:14Zinjecting model into mediator <div><p>Hi Vishwas,</p>
<p>I realise that I have a vested interest, but it would be worth
buying the "Actionscript Developer's Guide to Robotlegs" - you can
get it as an ebook from O'Reilly. It's intended to be a guide for
developers at all levels, that takes you through everything you
need to know to get up and running with Robotlegs properly.</p>
<p>hth,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T16:35:05Z2012-05-31T16:35:05Zinjecting model into mediator <div><p>k, thnx. I will get one.</p></div>vishwas.gagranitag:robotlegs.tenderapp.com,2009-10-18:Comment/163328082012-05-31T21:50:38Z2012-05-31T21:50:41Zinjecting model into mediator <div><p>Do. I do not have a vested interest, but it taught me all I
needed to know, quickly. And I'm not super-smart either. If you can
figure out PureMVC without a degree in CS, you'll be all over this
in no time.</p></div>wagster