tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/966-factory-pattern-constantsRobotlegs: Discussion 2012-07-19T07:27:26Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/173643042012-07-18T09:04:54Z2012-07-18T09:04:54ZFactory pattern / constants<div><p>Hi lex,</p>
<p>There are a few approaches I’m aware of:</p>
<ol>
<li>reference static constants directly in the view</li>
<li>model - event - mediator - pass payload(VO) to the view</li>
<li>inject the VO as an interface into mediators and pass it to the
view (use injector.mapValue)</li>
<li>fluent factory</li>
<li>Stray’s request provide pattern</li>
</ol>
<p>Obviously you are already aware of the factory method –
you mentioned it in your title.</p>
<p>It sounds like your configuration “Object”
won’t change after run time, thus you could inject it into
your mediators as an interface, exposing only getters, without
contravening the law of “do not inject models and services
into mediators”. No penalty fees will be charged :)</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/173643042012-07-18T15:51:12Z2012-07-18T15:51:12ZFactory pattern / constants<div><p>Sweet — I will inject, then, pass GO and collect my
$200!</p></div>lextag:robotlegs.tenderapp.com,2009-10-18:Comment/173643042012-07-19T07:27:25Z2012-07-19T07:27:25ZFactory pattern / constants<div><p>Cool!</p></div>Ondina D.F.