Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with generic
Message
From
18/07/2007 14:17:07
Victor Acosta
Independent Programmer.
San José, Costa Rica
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01241343
Message ID:
01241681
Views:
36
Well , I am using a code generator called Subsonic to create my DALs, each table is presented as a collection.

See the tree:

Final Object (n objects)
public partial class Region : ActiveRecord<Region>    //one for each table.
public partial class RegionCollection : ActiveList<Region, RegionCollection>


Next level
public class ActiveList<ItemType, ListType> : AbstractList<ItemType, ListType> 

Next level
public abstract class AbstractList<ItemType, ListType> : List<ItemType>, ITypedList
        where ItemType : AbstractRecord<ItemType>, new()
        where ListType : AbstractList<ItemType, ListType>, new()

public abstract class ActiveRecord<T> : AbstractRecord<T> where T : AbstractRecord<T>, new()
public abstract class AbstractRecord<T> where T : AbstractRecord<T>, new()
As you can see the generator will create a collection for each table, each collection is derivated from Activelist.


Suggestion ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform