Micro Project Practice (7): Definition of data access

Source: Internet
Author: User
Tags abstract

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.