Nicholas Wieland wrote at 2005-7-27 13:54 +0200: >Well, not exactly - just a way to separate access to data from everything else >in the product. >Maybe a separate class that needs the connection as argument and that just >returns the data I need in appropriate data structures by calling class >methods. > >class DataModel (object): > > def __init__ (self, conn): > self.conn = conn > self.sqlFetchSomething = SQL (.....)
I think, a class variable "sqlFetchSomething" would do a better job -- unless "SQL" depends on "conn". Advantages: * fewer objects in the ZODB, fewer loads, faster operations * easier evolution of your SQL (in you need to change the SQL executed) -- Dieter _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )