[ZT] UI, BLL, model, and Dal Analysis of ASP. NET Common Reference Projects

Source: Internet
Author: User
Application/Project Name UI Layer implementation Business Model & logic layer implementation Data access layer implementation
Personal Web site Starter Kit On the ASP. NET page, you can use objectdatasource to bind methods in photomanager to obtain and update data. Two data entity classes (album and photo) and one management class (photomanager)
Solve the database connection and use sqlcommand to call the stored procedure.
Club Web site Starter Kit Use sqldatasource directly on the ASP. NET page to obtain and update data There are only some simple helper/utility classes, and most of the business logic is implemented on the page There is a dataset that extracts data from the member table and expands the sqlmembershipprovider field in your database.
classifieds site starter kit on the ASP. NET page, add, delete, and modify operations are implemented by using formview to call modeldb in BLL. The data list mainly uses the list of modelcache It is bound to the modelable able returned by modeldb. 1) The modeldb class is implemented in Bll, and dataset in dal is called to update the data. If the data is queried (getmodellist), modeldatacomponent is obtained. modeldatatable, which is a class in the Code automatically generated by the dataset

2) in the web directory of app_code, the cache function of some objects in HTTP context is implemented, and the cachedmodel (data entity class) and its management object modelcache are established, the latter converts the retrive result datatable of modeldb on The bll layer to list.

all datasets in ASP. NET 2.0 are used to obtain and update all table data. They are implemented by calling the Stored Procedure
commerce starter kit in ASP. on the net page, some of them directly call the modelmanager object to complete user interaction, some of them use objectdatasource to bind modelmanager to achieve the same function

for some operations, if no corresponding modelmanager exists, use sqldatasource directly

1) define the data entity class under the objects directory, including the get/set method definition for all attributes, without instantiating the method, but use void load (idatareader) in this example, an object (shoppingcartitems) is inherited to the able and initialized using builddatatable ().

2) several modelproviders are used to encapsulate the main interaction functions of the database and provide the object-level crud

3) There are several modelmanagers under The bll directory, provides model-based operations on the business layer, mainly by calling modelprovider to complete specific operations

In the modelprovider project, the modelprovider abstract class is defined first, and then inherited by sqlmodelprovider. In the latter, sqlhelper is used to access data, mainly to call the Stored Procedure
Du wamish 7.1
(. NET 1.1)
Call the methods in ordersystem and productsystem in businessfacade to complete user interaction. This is done by calling the relevant objects in the Dal layer. 1) modeldata, inherited from system. Data. dataset, calls builddatatables () in the constructor to initialize a datatable to store model data.

2) In businessfacade and businessrule, business logic-related content is implemented, and data layer models are called to complete data access.

Implements several models objects and provides the crud Method for modeldata. It also calls sqlhelper to complete interaction with the database.
Jobs site Starter Kit Use objectdatasource to bind the model class. Command mainly calls the crud method of the model. All attributes and crud methods are defined in the model object. The Dal dbaccess object is called during implementation, and objects such as sqlparameter are used. There is only one class dbaccess, which belongs to the tool class and is similar to sqlhelper. It is implemented using system. Data. sqlclient. If it is transplanted to other databases, the amount of code is small.
Timer tracker Starter Kit Use objectdatasource to bind the model class. Command mainly calls the crud method of the model. All attributes and crud methods are defined in the model object. Dataaccess: abstract class, which defines the data access method for the Dal layer to implement crud of all models.

Dataaccesshelper: factory class. You can use the configuration to create the corresponding dataaccess object.

Sqldataaccess: SQL server implementation of dataaccess, which also contains some common methods similar to sqlhelper to simplify code

. Text 0.95
(. NET 1.1)
Most of them call the model and directly call sqldataprovider to obtain and update data. The dottext. framework component defines the business entity model and modelcollection, and defines the models class in dottext. Framework. It mainly uses the crud method that provides the model, where R returns the modelcollection. The idbprovider and idtoprovider interfaces are defined in the data of dottext. Framework, and the datadtoprovider and sqldbprovider implementations are provided. The sqlhelper class is called.
Community Server 2.1 SDK
(. NET 1.1 & 2.0)
Directly call the models method to obtain and update data. Define the model class in the components of the communityservercomponents project, which only contains the attribute definition and constructor, and also defines the models class, which implements the model crud method, it calls the commondataprovider under the provider to complete data access. In the proivder of the communityservercomponents project, the abstract class commondataprovider is used to define all the data access methods required by the BLL & model layer, and then sqldataprovider is used in the sqldataprovider project to inherit this class, complete interaction with the SQL Server database
. Pet Shop 4.0 On ASP. NET pages, most of the model objects at the BLL layer are called by code to obtain and update data. The model project defines all business entities modelinfo
The bll project defines the business entity model, which contains the crud methods from the business perspective. They are implemented by calling the crud method of the imodel in idal.
The idal project has multiple interfaces defining the imodel, which defines the crud method of the model to be implemented.
Sqlserverdal and oracledal implement idal on the two databases respectively.
Dalfactory is the factory class and is responsible for returning the corresponding idal imodel implementation class according to the configuration.
Dbutility is a tool class for SQL Server and Oracle database operations, mainly sqlhelper and oraclehelper

Simple personal comment:

    1. personal Web site starter kit: simple for beginners
    2. Club Web site starter kit: A record of standard membership scalability
    3. classifieds site starter kit: The structure is clear and dataset is used to simplify the compilation of a large number of SQL code.
    4. commerce starter kit: using the provider model, there are some flaws, such as sqldatasource In the UI Layer and datatable in the Model
    5. duwamish 7.1: the architecture is clear, but the model inherits from dataset. Therefore, the builddatatables and curd methods in models are troublesome and have a large amount of Code
    6. jobs site starter kit: simple, practical, and has some disadvantages. For example, sqlparameter of the crud method of the model causes BLL and Dal to be unable to be completely isolated
    7. timer tracker starter kit: a clear and good implementation mode with a slightly larger amount of Code
    8. . Text 0.95: Based on. NET 1.1, The bll layer is slightly complex, and the amount of code on the Dal layer is large.
    9. Community Server 2.1: It is compatible with. NET 1.1 and. NET 2.0 at the same time, so it does not take advantage of many features of. NET 2.0, but its provider mode is clearer
    10. . Pet Shop 4.0: Clear architecture
Related Article

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.