asp.net| Beginner | design
petshop4.0 Design Instructions
first, the project name and Description: (Realization step: 4-3-6-5-2-1)
1, web= presentation layer
2. bll= Business Logic Layer
3. idal= data Access Layer Interface definition
4. model= Business Entity
5, dalfactory= the data layer of the abstract factory (create reflection)
6. Sqlserverdal=sqlserver data Access Layer/oracledal=oracle data access Layer
Dbutility Database Access Component base class
second, project reference relationship
1, Web reference BLL.
2, BLL reference Idal,model, use Dalfactory to create an instance.
3, Idal reference Model.
4, Model without reference.
5, Dalfactory reference Idal, by reading the web.config set in the assembly, load the instance of the class, return to BLL use.
6, Sqlserverdal Reference Model and Idal, Dalfactory loaded assembly, implementation of the method in the interface.
Third, the realization step
1. Create model to realize business entity.
2, create idal, implement interface.
3, create Sqlserverdal, implement the method in the interface.
4, increase the configuration information in the web.config, for the Sqlserverdal assembly.
5, create dalfactory, return an instance of the assembly's specified class.
6. Create BLL, call Dalfactory, get an instance of the assembly-specified class, and complete the data manipulation method.
7, create the Web, call the BLL in the data operation method.
Attention:
1, the assembly name in the web.config must be the same as the output assembly name in Sqlserverdal.
2, dalfactory only need a dataaccess class, you can complete the creation of all the assembly instances.
3. After the project is created, be careful to modify the default namespace and assembly name for each purpose.
4, pay attention to modify the project dependencies in the solution.
5. Note that the project references are added to the solution.