tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/703-managing-multiple-galleries-on-the-stageRobotlegs: Discussion 2018-10-18T16:35:33Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/109396752011-10-28T11:48:33Z2011-10-28T11:48:33ZManaging multiple galleries on the stage<div><p>Quickest clean-ish fix I can think of:</p>
<p>wrap the vos in a model with a method:</p>
<pre>
<code>getVOByViewInstance():VO;</code>
</pre>
<p>Inject that model as a read-only interface (showing only this
method) into the mediators. Let the mediator retrieve the VO for
the view using this API. (Inside the model you use a dictionary
where the views are the keys and the VOs are the values).</p>
<p>It's not ideal, and it feels as little as though your design is
a bit upside down, but this will fix it without causing much
spaghetti.</p>
<p>As you implement that it should become clear how to separate the
galleries - I wouldn't make a call on that until you've fixed the
first problem.</p>
<p>hth,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/109396752011-10-28T12:20:30Z2011-10-28T12:20:31ZManaging multiple galleries on the stage<div><p>Thanks Stray! It's not too late yet to refactor everything.<br>
How would you organise this if written from scratch?</p></div>Og2t