I've started on a simple Spring Diary application that uses JPA and Hibernate for ORM.
I have a couple of models that depend on each other. For instance a User can have many Days which can have many Notes. So I created a service-class for each model. But when I want to create a Day I need access to the corresponding User object that must be set. I don't want to have multiple service classes injected in one controller. That feels bad somehow. Is it bad?
My question is basically: What is the best approach when designing service classes for Spring? Should I just put it all in one service class and persist or merge the User when I want to save my changes? That feels so wrong! I want every class to do one thing for ease of maintainability. One big bloated service class is harder to understand and maintain is my opinion. Should I have service classes that call other service classes? Should I start with the models or the use cases or is there some other approach?
I'm surprised that I can't find any examples on how to design this crucial part of the application.