Profile property Management for. Net PetShop 4.0

Source: Internet
Author: User
Tags oracle database

. NET 2.0, provides asp.net membership management, ASP. NET role management and ASP.net configuration file properties. In this paper, we focus on the design and implementation of the. Net PetShop 4.0 profile property management.

Profile properties are used to provide personalized service to users. In. Net PetShop 4.0, the same namespace as the profile properties is as follows:

PetShop.IProfileDAL
PetShop.OracleProfileDAL
PetShop.SQLProfileDAL
PetShop.ProfileDALFactory
PetShop.Profile

From their namespaces, you can see that the configuration file property management also uses the factory pattern. Let's look at the contents of each namespace in detail:

First, Petshop.iprofiledal namespaces

The Petshop.iprofiledal namespace provides an interface ipetshopprofileprovider that defines 10 methods, respectively:

GetAccountInfo
SetAccountInfo
GetCartItems
SetCartItems
UpdateActivityDates
GetUniqueID
CreateProfileForUser
GetInactiveProfiles
DeleteProfile
GetProfileInfo

Some of these methods are for shopping cart processing, some of the account information processing, some of the configuration file processing.

Second, Petshop.oracleprofiledal and Petshop.sqlprofiledal namespaces

The two namespaces each contain a Petshopprofileprovider class, which is an implementation of the interface Ipetshopprofileprovider. Of course, as can be seen from the name of the namespace, Petshop.oracleprofiledal is connected to the Oracle database, Petshop.sqlprofiledal is connected to the SQL Server database.

Three, petshop.profiledalfactory namespaces

Petshop.profiledalfactory provides a self-appointed class dataaccess, which has only one method Createpetshopprofileprovider, according to the Profiledal settings in Web.config, produces a conforming ipetsh Petshopprofileprovider class instance of the Opprofileprovider interface. Of course, this is the typical factory model.

Four, Petshop.profile namespaces

The Petshop.profile namespace provides a human-encapsulated class Petshopprofileprovider that inherits the. NET Framework ProfileProvider classes, overriding initialize, SettingsPropertyValueCollection, Setpropertyvalues, Deleteprofiles, Deleteprofiles, DeleteInactiveProfiles, Findprofilesbyusername, Findinactiveprofilesbyusername, Getallprofiles, Getallinactiveprofiles and Getnumberofinactiveprofiles methods, some static methods are created. A static method is created to implement a call to a method in Petshopprofileprovider through the PetShop.ProfileDALFactory.DataAccess class.

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.