I have thought a lot about this question, but couldn't found some clear answer on this:
As I've understood at the last time, business layer should works only with model objects. It shouldn't know anything about how and from we fetched this data. It lets us to use business layer API independently of DAO.
So, is it normal to use DAO methods calls inside Service layer or we should trying to reduce dependencies between them. Thus, I see 2 variants of relationships between layers:
- Controller –> Service –> Dao
- 1 step: modelObject = Controller –> Dao
2 step: Controller –> Service (modelObject)
So, which variant is right?