Online Course Selection System experiences

Source: Internet
Author: User

Nothing to say,CodeI think it is also old. The standard COM + three-tier structure only tells me what it feels like:

1. Differences between traditional and L3 architecture solutions:

Traditional Method: customer-ADO. Net-Database
The user accesses the web site through a browser, and uses ADO. Net to connect and operate the database. At this time, each user maintains a connection to the database. This solution has obvious shortcomings. Because the resources consumed by opening a connection are quite expensive, the web server throughput will be seriously affected when the number of users increases greatly, its performance will be greatly reduced.

Three-tier structure: client -- web server -- COM + application layer -- Database
On the basis of the above, a layer of COM + application is added to encapsulate all direct operations on the database into a component class, using the core services of COM + (Object pool, instant activation, etc) so that the database connection, operations and other activities are handed over to the COM + application layer.

Object pool: the object pool is used to share objects. The first customer who creates a new object will reduce the performance (because he wants to open the database), but as long as the customer releases the object, the object is returned to the object pool. Because you do not have to wait for the object to be created, the next customer of the object instance will obtain the instance created by the first customer. With the object pool service of COM +, you can share objects, by increasing the maximum and minimum shared capacity when the number of users increases, you can add components (resources) in a managed manner ). The more shared components that can be added, the more customers that can serve.

Instant activation: JITA has an important effect on the scalability of shared objects. JITA allows the object to be deactivated immediately after a method call, and then activated in the next method call. The component is released back to the object pool because the component cannot be properly controlled between method calls. Once the component returns to the shared pool, it becomes available to other customers.

2. The general three-dimensional method of COM + components:
[Transaction (transactionoption. requiresnew)]
[Objectpooling (true, 5,100)]
[Justintimeactivation (true)]
At the same time, a strong name must be generated with Sn and referenced.
[AutoComplete] before a method is used to declare a method-level transaction.

3. The call and return types of methods at the logic layer must be based onProgramBut do not have a standard.

4. if dataset is available, you should try to use dataset operations, whether it is query or filter. Do not operate the database, which not only greatly improves the performance, it also makes the code at the logic layer more concise (there is no need to implement many subtle database operation functions ).
For example, query:
Datarow [] rows = Ds. Tables [0]. Select ("cname = '" + this. listbox1.selecteditem. Text + "'");

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.