tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/202-should-model-dispatch-eventRobotlegs: Discussion 2012-01-16T15:34:47Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/20878702010-06-27T02:01:49Z2010-06-27T02:01:49ZShould model dispatch event?<div><p>Obviously you are welcome to build applications how you like
(model as POJO like object), but a model informing other actors
that it has updated its state is a solid practice.</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/20878702010-06-27T18:57:39Z2010-06-27T18:57:39ZShould model dispatch event?<div><p>I would strongly recommend not using the approach you outlined.
If anyone can modify the model from anywhere in the codebase and
must remember to dispatch the appropriate events afterward you will
end up with a lot of duplicate code (anti DRY), refactoring will be
difficult and error-prone, logic will end up in inappropriate
places, and your system will become hard to reason about.</p>
<p>A Model Actor in Robotlegs is supposed to provide a
single-point-of-access to your model (VO/POJO) and broadcast
messages when that model changes.</p></div>Shaun Smith