I am using Spring framework usually with the common simple form:
Controller <-> Service <-> Repository
And I usually have a common services that I put inside a CommonService
class and make all other serivces extends class.
A developer told me that it is better to inject the CommonClass
in each service instead of using inheritance.
My question, Is there one approch better than the other? Do JVM or performance affected by one more than the other?
Update
There is no direct relationship between CommonService
and other Services, it is not has-a or is-a relationship, it's like a utility service.