tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/394-how-to-move-logic-from-mediator-to-a-commandRobotlegs: Discussion 2018-10-18T16:35:33Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/105425802011-10-11T09:48:38Z2011-10-11T09:48:38ZHow to move logic from Mediator to a Command?<div><p>Hello,</p>
<p>I think that your feeling is correct. It is better to map the
events which are coming from GlassView to a command. Do the
calculations there and then dispatch another events which should be
handled by the ScrenView's mediator and update the SceneView.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/105425802011-10-11T10:02:27Z2011-10-11T10:02:27ZHow to move logic from Mediator to a Command?<div><p>Wow, that's fast! Yea, so that's the trick. Let a Command do the
calculations have it throw a new Event? Thanks.</p></div>Gert-Jan van der Weltag:robotlegs.tenderapp.com,2009-10-18:Comment/105425802011-10-11T10:07:23Z2011-10-11T10:07:23ZHow to move logic from Mediator to a Command?<div><p>Yep. Or at least that's what I think is the better choice. As
far as I know the job of the mediator is to make the connection
between the controllers and the views. It's not a place for "logic"
;)</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/105425802011-10-11T19:43:53Z2011-10-11T19:44:17ZHow to move logic from Mediator to a Command?<div><p>Or just move the calculations to the SceneView. View logic is
meant to be in the view, there's no rule against having complex
calculations in views. As long as the outcome of those calculations
isn't used anywhere else, not even in other views, then there's no
problem. Obviously if you're creating a very view-centric app, a
game for instance, then the view data is <em>possibly</em>
application data and then it would be appropriate to extract it out
of the view.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/105425802011-10-12T07:08:13Z2011-10-12T07:08:13ZHow to move logic from Mediator to a Command?<div><p>Ah yes, that's another good idea. That won't give me the undo
option, but it is much simpler. Thnx.</p></div>Gert-Jan van der Wel