Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with generic
Message
De
18/07/2007 14:17:07
Victor Acosta
Independent Programmer.
San José, Costa Rica
 
 
À
18/07/2007 11:28:43
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01241343
Message ID:
01241681
Vues:
37
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 ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform