On Feb 8, 2008 6:34 PM, Alexandre da Silva <[EMAIL PROTECTED]> wrote:
>
>
> > The Entity code won't change much in the future (except possibly to
> > react on a SQLAlchemy change), as most of the functionality is in
> > EntityMeta. Besides, this way you can customize your base class to
> > contain exactly the methods you want and only those (this is what I do
> > in my projects using Elixir).
>
> > To sum it up, people here already suggested the two options you have
> > as of now: either multiple inheritance or providing your own base
> > class by using the metaclass yourself.
> well, but I will need to create(copy and paste) the methods of Entity

Indeed, but I personally don't find this to be an important problem.

> > At some point, I wanted to be able to simply inherit from any class,
> > but that's not possible without marking the classes (one way or
> > another) which don't need to create a table. What I had in mind is
> > implementing some sort of "abstract" inheritance, which should
> > probably do what you want, but I haven't had time yet to do it (see
> > http://elixir.ematia.de/trac/ticket/15). Feel free to work on it   if
> > you want ;-). It shouldn't be too hard, but it involves some tinkering
> > at different places of the code (mostly in entity.py).

> hum, interesting...., maybe if we create a middle class should work,
> not?
>
> example:
>
> EntityBase(object):
>         move all methods from Entity to here.
>         ....
>
> Entity(EntityBase):
>         __metaclass__=EntityMeta
>
> then who wants to get just the funcionalities from Entity and create
> their own base class may choice if want the actual EntityBase features
> or want to write from beginning.

This is an interesting option I didn't think about. I'd like to hear
opinions from other people about this as I'm not sure if it's worth
it: are there many persons in your case (I don't think there are --
and those who are would probably be satisfied by the "abstract"
concept implementation which will need to be done anyway), and is
there a (relevant) impact (in terms of efficiency or mem usage) to
have one more level of inheritance for all objects?

-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to