3 ms·
Yes, key point is to separate classes if they have state or not. I have a simple convention in my code base, a repository does not have state, a service depends
by fetbaffe 7y ago
Yes, key point is to separate classes if they have state or not. I have a simple convention in my code base, a repository does not have state, a service depends on repositories & can have state, thus a repository can have lots of methods (different ways of retrieving data) & a service is specialized & only have small number of methods.
If an existing services does not match exactly what you need to do, you write a new service and reuse the same repositories.