Django Vs Rails

Jorge Godoy godoy at ieee.org
Thu Sep 15 14:14:38 EDT 2005


Jacob Smullyan <smulloni at smullyan.org> writes:

> I have mixed feelings about automagical schema introspection.  PyDO
> supports it, and will probably do so increasingly robustly if people
> use it.  But part of me feels that "explicit is better than implicit"
> may win out over DRY here, because the ORM layer and the db layer
> exist in different realms, and if the ORM layer adapts silently to
> changes in the db layer, other code is likely to fail in unpredictable
> ways, including silently, whereas an explicit declaration of what
> fields are in a table, for instance, will fail with a hard error.  But
> maybe this is anal retentiveness, akin to a need for strong typing.

I just wonder when it becomes bad having to declare everything.  For example,
we have databases with 600 tables.  Declaring them all again will make a huge
PITA and would not be very helpful, specially because there's already some
declarations at the ER diagrams, at the SQL script, inside the database, and
then again at each and every python class? 

Having the introspection is great in this case (even though it is boring
having to declare all those classes and tell them to fetch their structure
from the database it is better than having to "recreate" all of them).

With regards to failures, this is one of the reasons for unit tests :-)  They
can help finding out where is the problem and they should never fail
silently. 

-- 
Jorge Godoy      <godoy at ieee.org>



More information about the Python-list mailing list