asp.net common reference items UI, BLL, Model, DAL analysis __.net

Source: Internet
Author: User
UI, BLL, Model, DAL Analysis for common reference items in asp.net
application/Project Name UI Layer Implementation Business Model & Logic Layer Implementation Data Access Layer Implementation
Personal Web Site Starter Kit Use ObjectDataSource to bind methods in Photomanager to get data and update data directly on ASP.net pages Two data entity classes (Album, Photo), one Management class (Photomanager)
Resolve database connections by themselves, using SqlCommand to invoke stored procedures to complete
Club Web Site Starter Kit Use SqlDataSource directly on the asp.net page to get data, update data There are only a few simple helper/utility classes, the business logic is mostly implemented on the page There is a dataset that extracts data from the member table and expands the SqlMembershipProvider field in its own database
Classifieds Site Starter Kit
on the asp.net page, the increase/deletion/modification is mainly achieved by using the BLL in FormView call Modeldb. The data list uses the Modelcache list and modeldb returned modeldatatable to bind the Modeldb class in the
1) BLL and call the dataset in the Dal for data updates. For query data (getmodellist), get modeldatacomponent.modeldatatable, a class in the dataset's auto-generated code

2) in the App_Code web directory, This paper mainly realizes the cache function of some entities in the HTTP context, establishes the Cachedmodel (data entity Class) and its management object Modelcache, the latter mainly converts the Modeldb retrive result DataTable of BLL layer into The list
is all dataset in ASP.net 2.0, which implements the capture and update of all table data, which is implemented by calling stored procedures
Commerce Starter Kit on the asp.net page, there are some direct calls to Modelmanager objects to complete user interaction, while others use ObjectDataSource bindings Modelman Ager to achieve the same functionality

for some operations, if there is no corresponding Modelmanager, use SqlDataSource
1 directly, in the objects directory, the data entity class is defined, containing all the properties of the get/ The definition of a set method is initialized with void Load (IDataReader), with one object (Shoppingcartitems) inherited to the DataTable, without instantiating the method. The use of builddatatable () for initialization

2 uses several modelprovider to encapsulate the primary interaction functionality of the database, providing a solid level of crud

3) in the BLL directory, there are several Modelmanager, provides the operation of Model from the business level, where the main is to call Modelprovider to complete the specific operation
in the Modelprovider project, first define the Modelprovider abstract class, and then the Sqlmodelprovider to inherit, which uses SqlHelper to complete data access, primarily by calling stored procedures
Duwamish 7.1
(. NET 1.1)
Call the methods in OrderSystem and ProductSystem in BusinessFacade to complete the user interaction, mainly by calling related objects in the DAL layer to complete the 1) Modeldata, inherits from System.Data.DataSet, calls Builddatatables () in the constructor to initialize a DataTable to store the model data

2 in BusinessFacade and Businessrule, the implementation of the business logic-related content, call the data layer of the Models to complete the data access
Implements several models objects, provides a crud method for Modeldata, and it also calls SqlHelper to complete interaction with the database
Jobs Site Starter Kit Using the ObjectDataSource binding model class, Command is primarily called the model's Crud method All attributes and Crud methods are defined in the Model object, the DBAccess object of the DAL is invoked when implemented, and objects such as SqlParameter are used There is only one class DBAccess, which belongs to the tool class, similar to SqlHelper, it is implemented using System.Data.SqlClient, if porting to other databases, the amount of code is small
Timer Tracker Starter Kit Using the ObjectDataSource binding model class, Command is primarily called the model's Crud method All properties and Crud methods are defined in the Model object DataAccess: Abstract class that defines the data access method that the DAL layer needs to implement for all Model CRUD

Dataaccesshelper: Factory class, using configuration to create the corresponding DataAccess object

Sqldataaccess:dataaccess SQL Server Implementation, which also contains some common methods similar to SqlHelper to simplify the code
. Text 0.95
(. NET 1.1)
Most of the call model has a direct call to Sqldataprovider to get data, update data The business entity Model and modelcollection are defined in the Component of Dottext.framework, and Models classes are defined in Dottext.framework, mainly with the CRUD method of providing Model, where the R return to Modelcollection The Idbprovider and Idtoprovider interfaces are defined in Dottext.framework's Data, and then the Datadtoprovider and Sqldbprovider implementations are invoked, in which the SqlHelper class
Community Server 2.1 SDK
(. NET 1.1 & 2.0)
Call the Models method directly to get the data, update the data, etc. Define the model class in the components of the Communityservercomponents project, which contains only the attribute definitions and constructors, and also defines the Models class, which implements the model's CRUD method, which is called under Provider Commondataprovider to complete the data access. In the proivder of the Communityservercomponents project, the abstract class Commondataprovider defines the data access methods required by all BLL & Model layers, and then in Sqldataprovider Use Sqldataprovider to inherit this class from the project, and complete interaction with the SQL Server database
. Pet Shop 4.0 On the ASP.net page, most of the code is used to invoke the Model object of the BLL layer to get the data, update the data All business entities are defined in the Model project Modelinfo
The BLL project defines the business entity Model, which contains the crud methods of the business perspective, which are implemented by calling the Imodel Crud method in the Idal
The Idal project has multiple interface definitions Imodel, which defines the Model's CRUD methods that need to be implemented
Sqlserverdal and Oracledal were implemented on both databases Idal
Dalfactory is the factory class, 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 Evaluation: Personal Web site Starter Kit: Simple for beginners ' reference Club WEB site Starter Kit: An extension of the standard membership is worth seeing classifieds Site Sta Rter Kit: The structure is clearer, using a DataSet simplifies the compilation of a large number of SQL code Commerce Starter Kit: Using the Provider model, there are minor flaws, such as the Boundary UI layer Sqldatasource,model Able Duwamish 7.1: The architecture is clearer, but model inherits from the DataSet, so the Curd method in its builddatatables and Models is more troublesome, and the code volume is larger. Jobs Site Starter Kit: Simple and practical, Some drawbacks, such as model's SqlParameter of CRUD methods, cause BLL and DAL to be unable to completely isolate Timer Tracker Starter Kit: A well-defined, better implementation pattern, with only a small amount of code. Text 0.95: Based on. NET 1.1, the BLL layer is slightly more complex and the DAL layer code is larger Community Server 2.1: It is compatible with. NET 1.1 and. NET 2.0, so it does not take advantage of many of the features of. NET 2.0, but its P The Rovider model is clearer. Pet Shop 4.0: Structure clear note  

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.