tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/8355-data-and-injector-best-practiceRobotlegs: Discussion 2018-10-18T16:35:53Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/301828062013-11-26T10:25:16Z2013-11-26T10:25:16ZData and Injector Best Practice<div><p>Hi Philip,</p>
<blockquote>
<p>a) inject all values that don't change, e.g values coming from a
data.xml</p>
</blockquote>
<p>Of course it depends on the use case, but since you're asking
just for a general rule, I'd say it is absolutely ok to inject
immutable properties into the classes that need them for some kind
of configuration - user credentials, layout..</p>
<blockquote>
<p>b) create a model to hold those values that do change</p>
</blockquote>
<p>Yes, that's the role of a Model, to hold and manipulate
application's states<br>
<a href=
"http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/what-are-the-responsibilities-of-the-model-class-in-mvcs">
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/wha...</a></p>
<p>It is a good practice to inject Models against an interface.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/301828062013-11-26T10:44:08Z2013-11-26T10:44:08ZData and Injector Best Practice<div><p>Hi Ondina,</p>
<p>yes, I would find it quite practical to inject configuration
data and then use models for application states, etc.</p>
<p>Thanks,<br>
Philip</p></div>Philip