tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/912-timer-questionRobotlegs: Discussion 2018-10-18T16:35:39Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T07:40:05Z2012-05-10T07:40:05Ztimer question<div><p>hi guys,</p>
<p>im new to this, just want to ask where are Timer objects usually
put.<br>
i have a Screensaver (the view), ScreensaverModel,
ScreensaverEvent, and ScreensaverMediator.</p>
<p>thanks,<br>
carlos</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T09:12:57Z2013-07-03T14:14:32Ztimer question<div><p>Hi,</p>
<p>It depends on what the timer will be used for. From your naming
I'm guessing a Screensaver. :)</p>
<p>In a case like this I'll put it into the Model. The Timer will
then trigger the state change within the model, which in-turn
should trigger the view changes.</p>
<p>Hope that makes sense!</p></div>Matan Ubersteintag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T09:30:19Z2012-05-10T09:30:19Ztimer question<div><p>i would put the timer in your model tier, as it's part of the
application's overall state. model then dispatches timer related
events to rest of application</p></div>matttag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T09:40:28Z2012-05-10T09:40:28Ztimer question<div><p>but the event listeners TIMER_COMPLETE and TIMER are to be put
inside the Mediator right?</p>
<p>thanks</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T10:03:40Z2012-05-10T10:03:40Ztimer question<div><p>yes you would listen for the application events in the mediator
and act on your view accordingly</p></div>matttag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T10:20:13Z2012-05-10T10:20:14Ztimer question<div><p>is it ok if i have my timer events in the model, and dispatch
another custom event for the view? thank you so much for your
time.</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T10:51:19Z2012-05-10T10:51:19Ztimer question<div><p>yup don't see why not! probably better to use a custom event
for<br>
application specific purposes anyway - gives you more flexibility
and<br>
control in terms of what else you might want to send along with the
event.</p></div>Matt Sayerstag:robotlegs.tenderapp.com,2009-10-18:Comment/159026842012-05-10T11:03:57Z2012-05-10T11:09:13Ztimer question<div><p>i see, just as i thought. :D</p>
<p>im now curious how my model is instantiated :s</p></div>kakarlus