[orm-devel] post 1.0 and metaclasses

Diedrich Vorberg diedrich at tux4web.de
Wed Mar 31 11:22:19 CEST 2004

Hi Charles,

>I'm curious to hear what benefit you see in metaclasses vs the current
The most obvious benefit would be inheritance: your dbclasses could
subclass each other just like your tables in pgsql.

>It seems to me the added complexity detracts from the idea of a
>thin membrane.
Actually, orm's four-thousand lines are mind-boggllingly complicated
anyway ;-) The point is, orm's "datatypes" happen to mirror Python's
property classes. If I would have had the understanding of Python that
I have now I would have implemented orm with metaclasses. Using
metaclasses I can make datatype inherit from property. This will make
orm *much* more "pythonesque" i.e. closer to the intentions and style
of language and runtime-system.

>It also raises the barrier of entry for others to contribute
>to the code.
I can see that to understand metaclasses is difficult. To be honest, I
only understood them day before yesturday and I guess, without working
on orm I would not have understood them at all. But: In a way orm uses
a lot of tricks to "emulate" metaclasses and properties. Using the
actual technique provided by the language will make orm easier to
understand and maintain. 

>When you add this with some of the limitations that (i think) are
>imposed by metaclasses (i.e. globally unique class names) I'm not
>sure if there is a compelling case.  To me, this was one of the main
>distinguishing *features* of Object Membrane from SQLObject.
I'm not sure if globally unique class names is a limitation of
metaclasses or a limitation of SQLObject. I will have to

>Maybe features like automatic schema generation, or schema to class
>translators would attract more users instead?  I'm interested to hear
>more thoughts on the topic if anyone has them.
Me too... 

Ah... this is my first look at SQLObject for a long time... the syntax
I have in mind for orm is much the same as SQLObject's. I guess I'll
need to have a deeper look at it. 


Diedrich Vorberg <diedrich at tux4web.de>      .---.   /             \
http://tux4web.de Tel: 02302 425269        /     \ ((__-^^-,-^^-__))
                                           \.O-O./  `-_---' `---_-'
"Unix is simple, but it takes a genius     /`\_/`\   `--|o` 'o|--'
to understand the simplicity."            //  _  \\     \  `  /
                      - Dennis Ritchie   | \     )|_     ): :(
                                        /`\_`>  <_/ \    :o_o:
     Associate Member of the FSF #1245  \__/'---'\__/     "-"

More information about the orm-devel mailing list