Usually you put the DAO at the service level, because as your application becomes more complex, you will do useful and non-trivial things in the service. For example, you can coordinate complex data operations with more than 1 DAO. Service levels also provide API boundaries that distinguish between cross-cutting issues such as transaction management, authorization checks, performance logging, etc.
Another reason you can divert your functionality to services is that it encourages the use of reusable and supported components. When you start, you may be interested in just submitting some html. You write a service that loads some data, and processes the html part in a layer above the service level (presentation level). Now you want to support the RESTful web service. Your service level can be reused to download data; all you need to worry about is json or xml returned by the endpoint of the web service (and, of course, the REST semantics).
Thus, for simple cases, the level of service may increase slightly, but as your application expands, they become useful and even important to ensure clean code.
hvgotcodes
source share