I'm still not sure why you should not mix generics with interfaces.
Are we saying they are mutually exclusive? When it comes to constraints I thought this was a good approach? [EMAIL PROTECTED]
From: Yago Alvarado <[EMAIL PROTECTED]> Reply-To: "Discussion of advanced .NET topics." <[email protected]> To: [email protected] Subject: Re: [ADVANCED-DOTNET] Generics. How can I do a generic declaration? - SOLVED Date: Tue, 28 Mar 2006 04:59:38 -0500 Thank you Frans and Bruno for your help. In the end I managed to get it to work. I created an interface like below: public interface IDataManager<T> { List<T> SelectData(); int UpdateData(T objectToBeUpdated); ... } and then in the implementation I did as follows: public class StoreGroupDataManager : IDataManager<StoreGroup> { #region Implementation of IDataManager<T> public List<StoreGroup> SelectData() {...} public int UpdateData(StoreGroup objectToBeUpdated) {...} #endregion } This is not as flexible as using ArrayLists and avoiding generics (hence Frans warning about mixing generics with interfaces) but is flexible enough to allow me to pick among different IDataManager<StoreGroup> implementations in my business layer. I am loosing a little bit of flexibility but I'm hoping to increase the performance due to the use of generics over ArrayLists. Does anyone have any thoughts about this? Regards, Yago =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
