On 13/09/09 1:20 PM, Jos Elkink wrote:
> Hi all,
>
> Thanks for the great advice!
>
> I am still a little puzzled, though. If I use modules instead of
> inheritance, how would one code something like "list all items of this
> character"? Would it need to iterate over all types of items? I could
> imagine coding something that tracks all item types and then program a
> fairly short function that iterates over them, but that would lead to a
> very large number of queries (one for each item type) just to get the
> list ...
>
> Am I missing something? :)
No, you're spot on. The question becomes, do you actually need a list of 
all the 'items' intermingled together? In many cases I've seen STI, the 
answer is no, though that doesn't mean your answer is 'no' :)

Xav

>
> Jos
>
> On Fri, Sep 11, 2009 at 12:42 PM, Xavier Shay <[email protected]
> <mailto:[email protected]>> wrote:
>
>
>
>
>     On 10/09/09 6:08 PM, Jos Elkink wrote:
>      > In terms of practical usage and coding, the inheritance definitely
>      > brings substantial benefits.
>     I used to use inheritance a lot for code reuse, but now I use modules
>     instead and am a happier man because of it.
>
>     I try to avoid STI as much as possible.
>
>     Xav
>
>      >
>      > Jos
>      >
>      > >
>
>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to