On May 11, 2006, at 12:03 AM, Daniel Miller wrote:

As I've already said, I object to adding a __call__() method in addition to the "current" property because it adds confusion about the "one obvious way" to get the current session. The "reference implementation" of your "session context" seems to be ScopedRegistry, which uses three different methods to support the functionality of the "current" property on SessionContext. I would argue that three methods are harder to remember than a single property, and therefore I think a property is better. Convince me that a callable is better and I will gladly change the SessionContext interface. But please, let's just have one simple interface rather than two.

i still like the idea of :

mapper needs the session corresponding to whatever session context a particular instance, or that instance's class would like to use.

        it calls:

                instance.__session__()

thats it ! thats the whole interface as far as SA core is concerned. it doenst want to involve itself with explicit contextual interfaces. im not sure if you still see that as a major issue....i know you dont like the name. but its a one method API. its just a single name. we can change it later. id like to just go with *something* for now. note that this does not solve the issue of the "non-class-associated context" which current_session() solves, thats something else which also must be decided.

so, it then does not matter if sessioncontext has a __call__ method. if it only has one method, "get_session()", then youd say:

        context = SessionContext()

        class MyClass(object):
                __session__ = context.get_session

So, the only advantage to a __call__ method is that youd be able to say:

        class MyClass(object):
                __session__ = context

less typing, but less explicit. doesnt matter much to me, so lets just skip the __call__().




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to