Re: [SQLObject] Why must SQLObject expose database connections to users?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ch...@se...> - 2008-05-06 19:19:42
|
Oleg Thank you. See reponses below. On Tue, May 06, 2008 at 10:53:29PM +0400, Oleg Broytmann wrote: > > Isn't a goal for ORMs to hide all this database connection stuff? > > Yes, but remember these things: > > 1. The Law of Leaky Abstractions - it is very hard to completely hide the > underlying level. > 2. There is no way for an ORM to guess where you do want to connect to. > 3. What if one would want to connect to two different databases? Should the > ORM to guess both connections? How?! Yes but couldn't this be done in a config file rather than in Python code? Unless I'm missing something, this is *already* done in TurboGears/SQLObject as the config file there defines a sqlobject.dburi variable! Chris |