jeudi 10 juin 2021

Clarifications needed on Designing Data Access Object (DAO) Layer - Spring Boot

I am trying to setup a DAO layer for a Spring boot project for which i came across this helpful blog .

I need some clarity on the below text , especially the part where it says that dependencies must not be implementation classes and that they need not exceed their domain.

"all DAO classes must get their dependencies injected through instantiation, not later at runtime, and dependencies must not be implementation classes. The DAO layer must ensure that bare minimum of dependencies DAO class needs does not exceed its domain, i.e. all dependencies should be interfaces related to persistence layer or other DAO interfaces only."

Kindly help/add/correct my understanding by providing some pointers . What i understood is

We should inject interfaces as dependencies in service class instead of auto wiring the concrete persistence layer implementation class .

Aucun commentaire:

Enregistrer un commentaire