The role of Dao

Dao is often used in practice, but to use Dao well, it is necessary to clarify the role of Dao.

Dao is data access object data access object.

The role of Dao is to simplify the writing of business logic. The code used to deal with specific technologies in the business logic is written into Dao separately for encapsulation, so as to express the main process of the business logic independently as much as possible.

That's what Dao does.

Is it possible to write Service logic without Dao?
Of course you can, but it's obviously better with Dao.

Is the logic in Dao business logic?
Of course, it's just that the business logic in Dao has to be tightly coupled with the data access technology. For example, combined query using hql.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327044735&siteId=291194637