Re: Using Power Ups

[email protected] Sun, 29 Jan 2006 23:10:44 -0500
Newsgroups gmane.comp.python.quotient.dev
Message-ID <20060130041044.2697.678548448.divmod.quotient.2467@ohm>

On Sun, 29 Jan 2006 19:00:22 -0600, Edward Muller <[email protected]> wrote:
>I'd need to model the following one to many relationship.
(...)
>I feel that this is something I should be able to do with a powerup, but
>anyway that I conceive it seems to come out wrong. Can anyone point me in the
>right direction or offer any pointers?

Go ahead and do it the "normal" way - this isnt' what powerups are for.

Powerups are not for representing domain abstractions.  They are for representing a very specific relationship: a group of plug-ins for a particular item via a particular interface.  In many cases that item is the Store itself.

In any event, you use items to represent relationships that the item itself doesn't know about.  For example, if you want to provide an in-database specialization of the view for a particular item, the model-item does not know about the view-item, only the adaptation or powerupsFor call for the appropriate interface will identify the view.

I haven't really come up with a good way to explain this yet, but the best guideline I can think of is "don't use powerups unless it's clearly obvious that you should".  While they're a powerful feature for some things, they're also *definitely* less efficient than using features specific to a concrete schema.