1 . Project Overview and Architecture analysis
Microsoft has just launched a pet shop 4 based on ASP.net 2.0, which has a completely new user interface. It's a good example of the study of ASP.net 2.0, and we all know that there has always been a debate between. NET and Java, which platform is the best enterprise-class application, optimal structure and highest productivity. In order to speak with the facts, the performance evaluation of various aspects of the project is then compared. NET and Java. The project that the user compares is PetShop. Because PetShop shoulder the above mentioned responsibility, all aspects must be optimal, architecture design should be carefully considered. So once it is launched, it becomes a model for developers, architects and others to study and research.
Recently, Microsoft has launched the PetShop 4 based on the. NET Framework 2.0 development. The new PETSHOP4 implements the same and even more features as PetShop 3, with Master pages,membership and profile,sqlcachedependency, but the code volume is reduced by One-fourth. At the same time, the use of. NET 2.0 features in transactions, data caching, and security has built a flexible best practices application.
They took advantage of Project Conversion Wizard to migrate projects from ASP.net 1.1 to ASP.net 2.0, and then made the following changes:
1. Replaces the transaction functionality provided by the original serviced components with System.Transactions
Code implementation: PetShop.BLL.OrderSynchronous's public void Insert (PetShop.Model.OrderInfo order).
2. Replace the original weakly-typed collection with a strongly typed generic set
Public ilist<productinfo> getProductsByCategory (string category)
{
return new If the string is empty
if (string. IsNullOrEmpty (category))
return new list<productinfo> ();
Run a search against the data store
Return DAL. getProductsByCategory (category);
}
3. Use ASP.net 2.0 membership to authenticate and authorize
4. Custom asp.net 2.0 Membership Provider for Oracle 10g was created
5. Use asp.net 2.0 's custom Oracle and SQL Server profile Providers to do user state management, including shopping carts, etc.
6. Uses master Pages to replace the original user controls to achieve a unified interface effect
7. The ASP.net 2.0 Wizard control is used to implement Check-out
8. SqlCacheDependency is used to implement cache update (cached invalidation) function at the database level
9. Message Queuing is used to implement a different-time order processing.
2. Overall structure:
database : (tentatively)
Project list : From the whole can be seen, Pet Shop 4 of the project system has been very large, considering the aspect is more comprehensive and complex than 3.0.
Serial number
|
Project name
|
Describe
|
1 |
Bll |
Business Logic Layer |
2 |
Cachedependencyfactory |
Factory class for caching dependency classes |
3 |
Web |
Presentation Layer |
4 |
Dalfactory |
Abstract Factory of data layer |
5 |
Dbutility |
Data Access Class component |
6 |
Ibllstrategy |
Synchronous/Asynchronous Policy interface |
7 |
Icachedependency |
Cache Dependency Class Interface |
8 |
Idal |
Data Access Layer Interface definition |
9 |
Imessaging |
Different-time processing Message Queuing interface definition |
10 |
Iprofiledal |
Data access layer interface definition for profile |
11 |
Membership |
Membership Authentication and Authorization management |
12 |
Messagingfactory |
Abstract factory for processing message queues at different times |
13 |
Model |
Business Entities |
14 |
Msmqmessaging |
Implementation of different-time processing message queues |
15 |
Oracledal |
Oracle Data Access Layer |