On Sep 12, 12:40 am, Carlos cubas <veno...@hotmail.com> wrote:
> 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,

this is the current implementation of
DetachedCriteria.GetExecutableCriteria(ISession)

                public ICriteria GetExecutableCriteria(ISession session)
                {
                        impl.Session = session.GetSessionImplementation();
                        return impl;
                }

The impl.Session property (which is CriteriaImpl.Session) is actually
an ISessionImplementor type. The implementation of
session.GetSessionImplementation() actually only returns the instance
of SessionImpl class, since it implements ISessionImplementer
interface.
Both SessionImpl and StatelessSessionImpl implements the
ISessionImplementor interface.

OK, now let's put aside the problem common base interface for ISession
and IStatelessSession for awhile. What I request isn't actually a
common interface for both session interfaces. It's only this:

        public ICriteria GetExecutableCriteria(IStatelessSession
statelessSession)
        {
            impl.Session = (ISessionImplementor) statelessSession;
            return impl;
        }

Let me know please where I'm missing with it.

Thanks!

Reply via email to