<div dir="ltr"><div><div>I don&#39;t know if this is the proper list, but I assume most Magritte users use it for Seaside :)</div><div><br></div><div>Let&#39;s suppose I&#39;m building a Seaside component by sending #asComponent to my domain model, that has one description like this:<br>

</div><div><br></div><div>descriptionStore</div><div><span class="" style="white-space:pre">        </span>&lt;magritteDescription&gt;</div><div><br></div><div><span class="" style="white-space:pre">        </span>^MASingleOptionDescription new</div>

<div><span class="" style="white-space:pre">                </span>label: &#39;Store&#39;;</div><div><span class="" style="white-space:pre">                </span>accessor: #store;</div><div><span class="" style="white-space:pre">                </span>beRequired;</div>

<div><span class="" style="white-space:pre">                </span>options: Store readAll; &quot;I want to replace this&quot;</div><div><span class="" style="white-space:pre">                </span>yourself</div></div><div><br></div><div><br></div>
<div>
I want to replace the access to the global (Store in this case) by a collection I &quot;inject&quot; somehow, coming from the Seaside session in this case.<br></div><div><br></div><div>In my component I can evaluate something like &quot;self session allStores&quot;, and that&#39;s what I&#39;d like to inject into the creation of the description.</div>

<div><br></div><div>Is there some kind of pattern to solve this? Which also introduces some coupling with a global (Store), difficulting its testing.<br></div><div><br></div><div><br></div><div>In the top of my mind I&#39;m thinking of something like the following:<br>

</div><div><br></div><div>&quot;in the context of a WAComponent&quot;</div><div>self call: (myModel asComponent: self session)</div><div><br></div><div>And then inject the session to something like:</div><div>descriptionStore: aSession<br>

</div><div><div><span class="" style="white-space:pre">        </span>&lt;magritteDescription&gt;</div><div><br></div><div><span class="" style="white-space:pre">        </span>^MASingleOptionDescription new</div><div><span class="" style="white-space:pre">                </span>label: &#39;Store&#39;;</div>

<div><span class="" style="white-space:pre">                </span>accessor: #store;</div><div><span class="" style="white-space:pre">                </span>beRequired;</div><div><span class="" style="white-space:pre">                </span>options: aSession allStores;</div>

<div><span class="" style="white-space:pre">                </span>yourself</div></div><div><br></div><div>Best regards,</div><div><br></div><div>Esteban A. Maringolo</div>
</div>