cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Menard <nirvd...@gmail.com>
Subject Re: Mapping fake FKs as relationships?
Date Mon, 11 Jan 2010 01:46:21 GMT
On Sun, Jan 10, 2010 at 8:21 PM, Aristedes Maniatis <ari@maniatis.org>wrote:

> On 11/01/10 12:08 PM, Kevin Menard wrote:
>
>> More complicated would be AR's notion of polymorphic relationships, which
>> I
>> guess were added as a way to avoid join tables.
>>
>
> My coincidence Lachlan Deck and I were discussing this just this morning.
> We have to think about what is involved, but what about an interface you can
> define in CM on which you can then perform a Query? Then rather than forcing
> inheritance on users, you could just define an interface.
>
> The common examples (as per the original poster) are attachments, comments
> and tags. So you want to be able to define a Taggable interface implemented
> by Artists, Paintings, etc. That then ties back to Tags and a special
> many-many Taggable_Tags join table with "foreign_key" and "foreign_table"
> fields. This implementation looks a lot like vertical inheritance, but
> without the inheritance.
>

So, the problem I've always had with this approach is that renaming a table
invalidates your data.  Additionally, you're always doing a join on a
varchar field for which an index may not buy you a whole lot (best case is a
1/n partitioning).  The benefit is you don't need n join tables.

-- 
Kevin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message