Introduction
The built-in ASP.NET Membership, Roles, Profile providers fits into many Web site use-cases, but not
all.
While I was wokring on some of my projects I have experienced the need of having a light ASP.NET providers
pack.
Providers that work without database or additional services. Providers that can easy deploy with a Web
site under restricted hosting environment.
The obvious solution was to implement ASP.NET Membership, Role, Profile providers base on XML file storages.
In this series I'll go through the steps of my implementation of
ASP.NET XmlProviders.
Background
In the first article I have
shown you the Persistable base class.
In this artcicle I'm going to cover the usage of the Persistable to implement the XML membership
store.
The purpose of XML membership store is to define the membership data which have to be persisted and
how to be persisted.
The XML membership store implementation involves next classes: XmlUser, XmlUserStore
and XmlUserStore.SynchronizedStore.
XmlUser
XmlUser just defines the data to be persisted per user:
<summary>
XmlUserStore
XmlUserStore implements Persistable and defines the persistance of all users to XML file:
XmlUserStore.SynchronizedStore
SynchronizedStore is a private nested synchronized implementation of XmlUserStore:
public partial class XmlUserStore {
Synchronized XmlUserStore
Now when we have a synchronized implementation of XmlUser store, we just have to provide the ability
to synchronize every instance of XmlUserStore.
The standard pattern to acheave that, is to add a static method Synchronized to the class with argument
the instance which have to be synchronized:
#region Static Methods
Points of Interest
You can find ASP.NET XmlProviders project and all the source code at
http://codeplex.com/aspnetxmlproviders
History
- 30.Mar.2008 - Initial release