Saturday, November 29, 2008

Understanding if a model-controller couple is needed

Hi all. This is my first message here.
I want to make it clear first that I read the (almost) whole
documentation and now I'm going to develop a first application. I
still have a doubt about dealing with HABTM relationship.

I give you the precise picture.

I have two entities: movie (motion picture) and reviewer. These are in
a HABTM relationship, which represents the review. I'll create the
conventional db tables: movies, reviewers and movies_reviewers. Note
that movies_reviewers isnt just a join-table, it includes other
informations beyond the foreign key (the vote of the review, the text
of the review).

Now I ask: do I need a model for the review? Is the review an object
in my application?

If so, which table should this model class be linked to? Directly to
join-table?

Should I make a whole another design? Dont know... with three
entities (movie, review, reviewers) and two merely associative
relationships (with a movie_id and a reviewer_id in the reviews
table)?

Thank you. And forgive me for bad explanation and for not having found
this topic in other threads. I'm italian and I'm a bit in difficulty
at retrieving technical infos in a foreign language.

Thank you in advance. : )

Fabio M

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: