This looks oddly like the repository pattern
http://www.martinfowler.com/eaaCatalog/repository.html

Might be worth reading up on it to learn a bit about the strengths/weaknesses.

Cheers,

Greg

On 7/1/07, Ron Young <[EMAIL PROTECTED]> wrote:
interface IEntityProvider<T> where T: BaseEntity

{

               T Get(int id);

               List<T> GetAll();

}



interface IUserProvider : IEntityProvider(User)

{

               User FindByLastName(string lastName);

}



class ProviderFactory<I, T>

               where I: IEntityProvider<T>

               where T: BaseEntity

{

               public static I CreateProvider(){}

}



IUserProvider x = ProviderFactory<IUserProvider, User>.CreateProvider();

User y = x.FindBy...

User[] yy = x.GetAll().ToArray();



I wrote that recently and have a prototype built around it.



Any comments will do I suppose.



Ron


===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



--
Studying for the Turing test

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to