Microsoft. NET Pet Shop 4.0 learning journey (4)-source code of layer-7 Architecture

Source: Internet
Author: User

Microsoft. NET Pet Shop 4.0Study Tour (4)

Layer-7 ArchitectureSource code

 

Today Pet Shop 4.0 Core layer-7 SourceCode. Including: Model Entity layer, Dbutility Data Access abstract class, Idal Data access interface layer, Sqlserverdal Data access layer, Dalfactory Data Access factory, Bll Business logic layer, UI Interface layer.



After thinking about it, there is nothing to say. Let's check it out by sending the source code. Only pay attention to the details.

 

1, 【 App. config ] (The configuration file is in Ui \ ): Name = "loggingdb" Is the database connection keyword. Key = "assemblydal" YesProgramSet keywords (that is, the prefix of the last generated file name, for example: Petshop4.sqlserverdal. dll ). Key = "namespacedal" It is the default namespace keyword of the program and corresponds to the property settings of the project.

2, 【 Demo. SQL ]: Install this script before running the program. This script creates a table ( Demo ) , Demonstrate complete database addition, deletion, modification, query, and operations. This table includes the four most basic field types ( Int , Varchar , Decimal , Datetime ).

3, 【 UI Interface Layer: Interface Layer UI Only need to reference Model And Bll . But there will be another special reference below ( In red reference ) .


4, 【 Petshop4.sqlserverdal. dll ]: Note: This file is very interesting, because the factory class will load this assembly, Sqlserverdal The data access layer is not referenced by any layer (SEE ). UI Running folder ( \ UI \ bin \ debug ) Will not appear below Petshop4.sqlserverdal. dll . In this way, an error will be reported if the factory class fails to load the assembly! So I UI Intentionally Add a reference Sqlserverdal (Only to generate an assembly File Petshop4.sqlserverdal. dll ).

 

5,Summarize the above analysis to obtain the complete layer-7 structure diagram (10Relationship,1Special references ):

 

6,Source code implementationNManagement System Model of small and medium enterprises. This includes basic addition, deletion, modification, and query methods. We will continue to develop basic functional modules for enterprise applications on this platform next time.

 

7,  Source code


Note! In blogCommunityOther than reprinted, must note:
By Clark Chan
And Source: http://clarkchan.cnblogs.com/
Otherwise, reprint is declined!

//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////

 

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.