I've been a Java developer for more than 10 years. During this time I developped a strong sense for best practices and beneficial structures and patterns in software architecture.
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?
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 ^_^
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is there any particular reason why you introduced the
ClockProvider
instead of directly injecting theClock
instance? This seems like an extra level of indirection that does not bring much advantages here?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 ^_^