Hello Software engineers,
So I'm a programmer. Not an "engineer". When I do OOP, I mostly create classes and interfaces the way I want. I do not follow any design patterns... BUT now, not only I want to get better but also I need to write a software that won't be maintained by me...
I read in this book a method to organize classes. They say, for your data, you divide the application into the following layers : Domain (or Model) ; Persistence (or repository) and Service.
So Domain contains basically POJO classes. Inside the Domain, there is another package for the Repository (its interfaces and their implementations)
The Service contains interfaces and their implementations BUT here, services implementation classes call Repository objects and kind of repeat their methods. But they also said the more the business logic is complex, some other methods can be added to service classes. So Repository is just their for CRUD and service is there to give access to CRUD + more depending of business logic...
Did I understand it properly ? But why to they use all those interfaces ? Just implementations would be sufficient in my view. Why does it look like DAO ? The only difference here is that I don't see where different database implementation can be adapted as DAO factory does...
Can you help me better understand Domain, Persistence, Service architecture ?