Lets remember that a common interface implies a contract that much be satisfied in intent by both impls. StatelessSession usually has a completely different intent than the Session even though the share the same method names.
-Carlos Practice makes perfect, but if no one is perfect, why practice? > Date: Fri, 11 Sep 2009 10:26:03 -0700 > Subject: [nhibernate-development] Re: About NH-1922 > From: grahambu...@hotmail.com > To: nhibernate-development@googlegroups.com > > > It's the user of repository that doesn't necessarily care. All they > need to do is tell the Repository to "use performance mode" and the > Repository does all the wiring to use NH with a Stateless Session. > After that point they want to use the repository in the same way - > minus whatever restrictions the developer of the repository places as > a result of performance mode. > > It would be easier to do that wiring if StatelessSession and Session > implemented a common interface and extended it where methods/ > properties didn't apply. > > On Sep 11, 6:20 pm, Graham Bunce <grahambu...@hotmail.com> wrote: > > I agree, the Repository does need to know... (and if fact it does so > > that it can use NH in the correct mode) but it would still be easier > > to switch between session types if ISession and IStatelessSession both > > implemented an ICommonSession..... which considering they are both > > "sessions" would make sense. > > > > IMO anyway.