Microsoft. NET Pet Shop 4.0Study Tour (2)
Project Reference relationship1
First seen Pet Shop 4.0 OfSource codeI think the structure is very complicated. Today I only discuss the business logic layer ( Bll . I abstracted the basic 6 Layer, they are: Dbutility , Model , Sqlserverdal , Idal , Dalfactory , Bll .
1,Physical access layer 【Dbutility]: Stores and retrieves databases, including database connection string Information and Public static methods (adding, deleting, modifying, and querying databases ). It does not reference any other layer and belongs to the bottom layer.
2, business entity layer [ Model ]: Abstracts database tables, abstract database tables into Entity object classes (with private members and common attribute methods ). One Model instance ( instance ) indicates a record of the database table. It does not reference any other layer and belongs to the lower layer.
3, Data access layer 【 Sqlserverdal ]: Responsible for spelling Data Access SQL Statement and stored procedure, and then process the results returned by the database in ( Sqlserverdal ), Wait for other layers to call. Sqlserverdal Get Model Attribute spelling SQL String, and then put Dbutility (MACHINE) to obtain the dataset ( Dataset ).So Sqlserverdal ReferenceModel .So Sqlserverdal ReferenceDbutility . Because Idal Yes Sqlserverdal Interface Layer, used to define the noun space and return type of the data access layer. Sqlserverdal Encapsulates the interface processing method. It will inherit from the interface layer.So Sqlserverdal ReferenceIdal .
4, Data access interface layer 【 Idal ]: Yes Sqlserverdal Method abstraction, Sqlserverdal The processed data object is Model , So Idal The processing parameter (noun space) is also Model .So Idal ReferencedModel .
5,Based on the above4Projects,4Relationship, we can clearly obtain the following project relationship graph:
Summary: Idal Reference Model , Sqlserverdal Reference Model , Sqlserverdal Reference Dbutility , Sqlserverdal Reference Idal .
6,Due to the time relationship, the next introduction will also2Projects and4Links:
Note! In blogCommunityOther than reprinted, must note:
By Clark Chan
And Source: http://clarkchan.cnblogs.com/
Otherwise, reprint is declined!
//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////