On. NET edition (C #) CMP mode

Source: Internet
Author: User
Tags constructor object model

Mall Online 2, 3 months, has been too lazy to write something, in addition to the assorted things are also busy, so did not put the system at that time to do the entire structure of the mind to clean up, yesterday, just two days from Shenzhen to come back, how to feel is to do things again. When I first contacted the CMP mode, I looked at it for a few days, To Google Baidu inside a search, we blog park inside there are frog Frog Pond to improve the efficiency of software development Sanbang the use of CMP mode in the article has its detailed introduction, here I also to this use CMP mode to get real project when the problem to make a summary.

Project name: Huihai It Mall

URL: http://http://www.huihaimall.com/

Development environment: WinXP SP3, IIS5.0, Dreamweaver, VS 2005, Sql-server 2000

Project Description: The project realizes the browsing selection of the goods (mainly the IT products made by the company), the member merchandise collection, the order (order), the email recommendation to friends, the member points, the receiving Address book, the DIY automatic installation, and so on, the business logic is realized in this project with. NET (CMP) And the display is not necessarily all used. NET ASPX page to do, such as DIY installed is to use Flex to generate flash to achieve, but they are synchronized (with the landing and cancellation, including the member product collection, etc.). And one of the most important thing is that background management is also used to call. NET to implement, Because you want to provide the interface that flex invokes, all also provide several WebService pages (off and authentication see: Use Session or Cookie in WebService to implement WebService authentication (client is Flex)), In addition, when you send an AJAX request in jquery, the page transmits data to the JSON data (Flex seems to have been used in several places as well).

The screenshot of the Project solution is as follows:

Below, I have a brief introduction to my understanding as shown in the previous illustration:

Cmpservices It is primarily a base class for some CMP configurations and services, and their corresponding names and functions are as follows:

Name Function description
Cmpconfigurationhandler Inherits from IConfigurationSectionHandler to read the custom CMP configuration within the Web.config file.
CommandMapping Command mapping class, a container for a business, typically corresponding to insert, Delete, Update, select a stored procedure named CommandName, which may contain multiple commandparameter.
CommandParameter The stored procedure parameter class, which has attributes such as ParameterName, Size, Dbtypehint, and a Classmember property that represents the attributes of the corresponding entity model. The general parametername is @name and the Classmember value is name (preconfigured) because the parameter names of the generic stored procedure correspond to the column fields of the database entity model.
Containermapping A container mapping class, typically a business entity, such as a user, with insert, Delete, Update, select 4 commandmapping, And it has a key in the CMP mapping ID called Containermappingid and Containedclass corresponds to the Entity Object model name.
Containermappingset Multiple containermapping container Mapping collection classes, where the Hashtable can match containermapping according to the Containermappingid mapping ID key.
Persistableobject A persistent object base class that inherits from the entity class to achieve data retention (typically insert, Delete, Update command Operations).
Persistableobjectset Inherits from the Persistableobject, implements the data persisted saves the result (generally is the Select command operation).
Sqlpersistencecontainer The container base class for the business, the constructor needs to be containermapping, and contains the INSERT, Delete, Update, select Four virtual methods.
Stdpersistencecontainer The container of the business, constructor containermapping call the parent class constructor, according to Containermapping to insert, Delete, Update, select four methods to implement concretely.

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.