tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/866-changing-viewsRobotlegs: Discussion 2018-10-18T16:35:38Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/149995772012-04-03T23:42:22Z2012-04-03T23:42:22ZChanging Views<div><p>Hi Nick,</p>
<p>I would mediate the whole app by mapping your contextView class
to a mediator - the mediator will then be created immediately and
will be ready to catch that event and can ask the contextView to
switch the views over.</p>
<p>Let me know if you need to do more...</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/149995772012-04-04T11:23:57Z2012-04-05T11:39:28ZChanging Views<div><p>I see.. This is what I thought as well but I was confused about
including a command or not. For example, the solution you are
suggesting does not include a command, as I can see it, the
contextview mediator just listens for the event and does its job.
Its fine and really easy but when should the commands be used then?
Only in model-services scenarios?</p></div>nickttag:robotlegs.tenderapp.com,2009-10-18:Comment/149995772012-04-04T15:28:47Z2012-04-04T15:28:47ZChanging Views<div><p>Hey Nick,</p>
<p>Yes, Commands are most often used in Model / Service scenarios,
as is displayed in the original flow diagram: <a href=
"http://www.robotlegs.org/diagram/">http://www.robotlegs.org/diagram/</a></p>
<p>Generally it's smart to remember this rule: if you want to
manage Views, use Mediators.<br>
Also remember it's best practice to keep your Mediators as lean as
possible: have them function only as Event receivers and
dispatchers.</p>
<p>Good luck!</p></div>Abel de Beertag:robotlegs.tenderapp.com,2009-10-18:Comment/149995772012-04-04T16:25:16Z2012-04-04T16:25:17ZChanging Views<div><p>Thanks guys. Things are much more clarified now. :) For what its
worth the framework really refreshed me when I was at weird point
with my project. Refactoring has never been that much fun :)</p></div>nickt