In the previous article we analyzed the entity classes, this one we will see how data access is designed.
As you can see from the system structure diagram, we don't have any implementation part of database access so far, and business just gives Idatabase and ientitydataaccess the two interfaces that define what the data access is going to achieve. We believe that the implementation of data access is the details of the system, and the domain model (business logic) is abstract, abstract domain model definition, but does not care about, more independent of data access and database design and implementation. On the contrary, as the implementation details, the data layer is implemented according to the needs of the business logic and changes with the change of the business logic, which also conforms to the dip (interface inversion principle). The above system chart, after adding data access, should look like this:
Not only is data access dependent on business,ui--, whether it is windows or the Web, it is also dependent on business. When we develop the Web layer, we will reiterate this issue.