Teknoid and Crazy are right about the poor normalisation.

However,  I successfully used the idea once because it was necessary
for me to process all the 'comments' for 5 different models in
datetime order.  If I had to go and get the comments from 5 different
tables before I could process them,  it would have been a bigger
problem;  so, I suppose it depends on what you are doing.  However, in
this case,  maybe going against the standard normalisation advice
wouldn't be such a good idea if there wasn't a good reason for it.

If however, luigi7up still wishes to think about his idea,  I notice
that Martin Westin's approach for linking addresses to different
models was a little similar in concept and that thread might be worth
a read:
http://groups.google.com/group/cake-php/msg/75e6eb68be6b301a?hl=en

For simply reducing the number of tables,  luigi7up could of course
also consider the possibility of having a combined table, for example,
for News and Blog items.  He could perhaps call it Articles and
specify whether the article is a News or Blog item with a simple
flag.  He would then of course only require one Comments table too.
Of course he wouldn't be doing that if the fields are significantly
different,  but I have noticed that some CMS systems successfully
simplify their schemas by combining their content types into as few
tables as possible.

Best regards.

On Sep 6, 3:48 pm, teknoid <[EMAIL PROTECTED]> wrote:
> I see little benefit to this solution, having everything in one table
> is not necessarily a good thing.
>
> There are a few drawbacks to this solution...
>
> - Relying on two fields in order to establish an association
> - Lack of flexibility. What happens when you decide that Blog comments
> need to have additional fields?
> - Poor normalization
> - Possibly meaningless fields for certain records (i.e.
> blog_comment_vote) for Image comment (which does not require any
> votes)
>
> On Sep 6, 5:43 am, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > hola everyone,
>
> > while developing application something crossed my mind. What about
> > organizing all comments throughout  application in one database table.
>
> > What I mean is this:
>
> >  If application has some kind of Blog, News, picture gallery you woul
> > create blog_comments table, news_comments table etc.
> > What about table creating one table that would hold all comments ?!?
> > Table comments would have following fields (id, model_name, item_id,
> > author, text)
>
> > This table would get pretty huge very soon but there is some logic in
> > this approach :)
>
> > What do you think?
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to