It does. My idea was only slightly different: -In addition to the base class, define an interface IActiveRecord on which entity-based operations (save, update, delete) are defined as extension methods.
- Define static class Store<T> which exposes the static AR operations (Find, FindBy, queries and LINQ) - Basically, AR-Mediator is splitted in extension methods and Store, becoming obsolete in the process. - Define a generic interface IDao<T> which defines all operations and which is used by all AR-operations (extension methods, AR-Base, AR-Mediator, Store). - AR exposes registries for IDao<T> on scope and conversation-level. - AR Windsor integration automatically fills the scope/conversion registries with IDao<T> implementations found in the container. The results: IDao<T> allows mocking out DB-access for testing. It also allows proxying AR-operations above NH-Listener level, which is useful for extensions like transparent multi-tenancy etc. All existing operating methods (ARBase, ARMediator) can use the new infrastructure. New code can use the lighter IActiveRecord/Store combination. IActiveRecordMediator<T> isn't necessary anymore. Dependency injection is handled below the covers. Legacy code doesn't need to be changed to use full DI/IoC. One more thing: I'd like to group extension methods on an user-provided interface. Unfortunately, I didn't find a solution until now. Any ideas? -Markus 2010/7/24 Gauthier Segay <[email protected]>: > The main cons with ActiveRecordMediator that I have is relying on a > static class, (not dependecy injectable). > > The signatures are also not all easy to use for some operations (for > exemple, when I want to access the ISession object, there is no simple > overload, I have to pass a parameter which is useless when using > anonymous methods). > > I would like to have a base IActiveRecordMediator which contains the > barebone operations, and a set of extension methods rather than a big > static class. > > Does it makes sense? > > On Jul 23, 11:45 am, Markus Zywitza <[email protected]> wrote: >> Can you please go into details on this? >> >> -Markus >> >> 2010/7/15 Gauthier Segay <[email protected]>: >> >> >> >> > I'd like to see Pagination in core and being used by activerecord and >> > other frameworks. >> >> > Things leads to others, I'd love to see a well thought >> > IActiveRecordMediator, because I don't like using the static classes. >> >> > On Jul 14, 11:40 pm, John Simons <[email protected]> wrote: >> >> Another one to consider merging into Castle.MonoRail.Framework is >> >> Castle.Components.Pagination. >> >> Thoughts? >> >> I don't think is used by any other project? >> >> >> John >> >> >> ________________________________ >> >> From: Gauthier Segay <[email protected]> >> >> To: Castle Project Development List >> >> <[email protected]> >> >> Sent: Wed, 14 July, 2010 5:20:18 AM >> >> Subject: Re: Merging assemblies in MR >> >> >> moving it to Core would make more sense (to me), if it hasn't any >> >> dependency one System.Web >> >> >> On Jul 13, 7:04 am, Mauricio Scheffer <[email protected]> >> >> wrote:> MvcContrib uses Binder, but I agree with Ken, they can just ref >> >> MR instead. >> >> >> > On Tue, Jul 13, 2010 at 3:42 AM, John Simons >> >> >> <[email protected]>wrote: >> >> >> > > I may be missing something but is Binder now only used by MR? >> >> >> > > Because if it is, we should merge it into MR. >> >> >> > > ------------------------------ >> >> > > *From:* Ken Egozi <[email protected]> >> >> > > *To:* [email protected] >> >> > > *Sent:* Fri, 9 July, 2010 11:13:52 PM >> >> > > *Subject:* Re: Merging assemblies in MR >> >> >> > > +1 >> >> >> > > 2010/7/9 Henry Conceição <[email protected]> >> >> >> > >> Go ahead. >> >> >> > >> Cheers, >> >> > >> Henry Conceição >> >> >> > >> On Thu, Jul 8, 2010 at 11:58 PM, John Simons >> >> > >> <[email protected]> >> >> > >> wrote: >> >> > >> > Since everyone else is doing it! >> >> >> > >> > What are people's thoughts on merging a few MR assemblies? >> >> > >> > And which ones? >> >> >> > >> > I'm looking at: >> >> > >> > Castle.MonoRail.TestSupport + Castle.MonoRail.TransformFilters -> >> >> > >> > Castle.Monorail.Framework >> >> >> > >> > Cheers >> >> > >> > John >> >> >> > >> > -- >> >> > >> > You received this message because you are subscribed to the Google >> >> > >> Groups >> >> > >> > "Castle Project Development List" group. >> >> > >> > To post to this group, send email to >> >> > >> [email protected]. >> >> > >> > To unsubscribe from this group, send email to >> >> >> >[email protected]<castle-project-devel%2Bu >> >> > n >> >> >[email protected]> >> >> > >> . >> >> > >> > For more options, visit this group at >> >> > >> >http://groups.google.com/group/castle-project-devel?hl=en. >> >> >> > >> -- >> >> > >> You received this message because you are subscribed to the Google >> >> > >> Groups >> >> > >> "Castle Project Development List" group. >> >> > >> To post to this group, send email to >> >> > >> [email protected]. >> >> > >> To unsubscribe from this group, send email to >> >> > >> [email protected]<castle-project-devel%2Bun >> >> >[email protected]> >> >> > >> . >> >> > >> For more options, visit this group at >> >> > >>http://groups.google.com/group/castle-project-devel?hl=en. >> >> >> > > -- >> >> > > Ken Egozi. >> >> > >http://www.kenegozi.com/blog >> >> > >http://www.delver.com >> >> > >http://www.musicglue.com >> >> > >http://www.castleproject.org >> >> > >http://www.idcc.co.il-הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם >> >> >> > > -- >> >> > > You received this message because you are subscribed to the Google >> >> > > Groups >> >> > > "Castle Project Development List" group. >> >> > > To post to this group, send email to >> >> > > [email protected] >> >> > > . >> >> > > To unsubscribe from this group, send email to >> >> > > [email protected]<castle-project-devel%2Bun >> >> >[email protected]> >> >> > > . >> >> > > For more options, visit this group at >> >> > >http://groups.google.com/group/castle-project-devel?hl=en. >> >> >> > > -- >> >> > > You received this message because you are subscribed to the Google >> >> > > Groups >> >> > > "Castle Project Development List" group. >> >> > > To post to this group, send email to >> >> > > [email protected] >> >> > > . >> >> > > To unsubscribe from this group, send email to >> >> > > [email protected]<castle-project-devel%2Bun >> >> >[email protected]> >> >> > > . >> >> > > For more options, visit this group at >> >> > >http://groups.google.com/group/castle-project-devel?hl=en. >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> >> "Castle Project Development List" group. >> >> To post to this group, send email to >> >> [email protected]. >> >> To unsubscribe from this group, send email to >> >> [email protected]. >> >> For more options, visit this group >> >> athttp://groups.google.com/group/castle-project-devel?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Castle Project Development List" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group >> > athttp://groups.google.com/group/castle-project-devel?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Development List" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/castle-project-devel?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.
