DEV Community

Discussion on: Controlling the Time in Java

Collapse
 
skuzzle profile image
Simon Taddiken

Is there any particular reason why you introduced the ClockProvider instead of directly injecting the Clock instance? This seems like an extra level of indirection that does not bring much advantages here?

Collapse
 
rnowif profile image
Renaud Humbert-Labeaumaz • Edited

You are correct, it does not bring many advantages here. I guess I did that in order to avoid passing around JDK objects and encapsulate this in my own wrapper. It is more of an intuition than a well-thought decision ^_^