0

in robotlegs can a Timer be inside a model or should it be encpsulated in a service.

Example: lets say i'm implementing a digital clock in robot legs. Should the Timer that updates the clock be a part of the ClockModel, or should it be in a TimerService the creates a command which updates the ClockModel?

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216

1 Answers1

0

Check out the robotlegs best practices guide.

I will summarize but all the info is right there.

  • Model : used for storing internal application state
  • Service : used for storing state from external sources (db, rest service,..)

The distinction above is also made clear in the robotlegs class diagram

So to answer you question, a Timer can be used in either a Service or a Model, depending on the context you are using it in.

Their best practices guide is really top notch and they also have a great support forum with loads of Q&A

I can really recommend you to go through this book

Cheers

Dennis Jaamann
  • 3,547
  • 2
  • 23
  • 42