Comida411 wrote:
> wouldn't it be better to record changes made to a book by each account
> rather than creating a whole new record of  a book for each account
> that has that book... so each account would simply be pulling their
> book data off of one table which  would then pass it rhrough a filter
> containing  the changes made to that book if any by the account holder
>
> .. Imagine 1000 school  chiidren each have he same book Lets say 30 of
> them make changes to the title but the rest leave it as is  Can't we
> just record those changes instead of giving each child their own
> record of the book in the books table?
>   
Well, yes. It is a MySQL question, too, though - it's a matter of how 
you design your database tables and structure your models. I used a 
similar scenario - a calendar application. Suppose you had a recurring 
weekly event, same time and same day each week, but that the subject 
each week might be different. For example, a regularly scheduled 
Geometry class - it meets at the same time, but each class will have 
different subject material and after the fact, different study notes. 
But the event itself should remain untouched.

This is an example of a Has-And-Belongs-To-Many (HABTM) relationship. To 
go back to your example, each student can have multiple books, and the 
same ISBN-book will be disseminated to multiple students, which is a 
straightforward HABTM. You, however, have the added necessity of 
inserting extra details in the joining table. Which Cake 1.2 handles 
nicely, I believe (and thank God for that, as I'd built a manual 
solution in 1.1, which was ugly and kludgy - the same relation expressed 
as two independent hasMany relations, in both directions. Ech.).

Look at this: http://www.cakephp.org/files/OCPHP.pdf - particularly, 
slides 8 and 9.

HTH,
 -Toby Parent

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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