All right. I will only have comments for a few models, so dedicating a
table might even be an advantage. Comments on users might get a few
extra fields etc. How would you build a tagging system without using
polymorphic associations? It makes sense to use the same tables for
tagging multiple modules :/

http://github.com/mattetti/acts_as_taggable_on_steroids


On Apr 2, 2:50 pm, Tom Locke <[email protected]> wrote:
> > IMHO I don't see the great advantage of polymorphic associations for 
> > something like comments.  I prefer the approach that Tiago used in his 
> > Tutorial 20 in Rapid Rails with Hobo.  It just seems cleaner and simpler.
>
> > If I had 100 tables that I was logging with some common class, then I would 
> > use polymorphic.
>
> Fully agree with this position.
>
> I think that one of the hard parts of programming is that our intuitive grasp 
> on which things are large and heavy, and which are light, is often well off 
> the mark. For example we might go to great lengths in our code to avoid 
> creating some object more often than absolutely necessary, but we'll create 
> arrays and strings all over the place without a second though.
>
> Somehow it seems "obvious" that database tables are big heavy things, but 
> reducing the number of tables you have might not deliver any practical 
> benefit.
>
> As a rule of thumb (having been bitten in the past) I always avoid 
> polymorphism and STI. It seems to be working out pretty well so far.
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to