Hi there,
I've been trying to get into using CRC cards for my designs. My
impression coming to cake, (and the way I usually design) was that you
start with your database and build your models from there. This was
also backed up by the was Bake.php operates (i.e. a Model is required
before the Controller and View can be made) However,
what I've been told when using CRC cards is to leave the Model till
last and get your interactions between classes sorted first (Top down
development I suppose). Ok, so on
with the CRC session.
The only ways I've seen CRC cards used with MVC was an example in which
the actual Model, View and Controller classes themselves were being
designed. Since this is already done with cake, I don't need to bother
right?
However, should I be using separate cards for my M's, V's and C's in my
app? Taking a shopping cart as an example, should I have a CRC card for
the Product Model, another for the Product View and another for the
Product Controller? The way I have been trying is to leave them all as
one card.
Following from this, how much detail should I go into with the cards?
e.g. Here's the Product and shopping cart cards I was thinking of:
Product
------------------------------------------------------
Search
products
| Stock
View product details | Cart
Cart
------------------------------------------------------
Start new cart
| Checkout
Add products to cart |
Now, I know that there will be a cart_items table for the items added
to the cart, but should I have a card for this (as there will be a separate model) or just leave it as
above since the other Objects in the system will only interact with the Cart object?
>From the documentation and examples with CakePHP I've basically only
seen the Models as communication layer to the underlying database
table. Is it necessarily bad practice to steer away from this? Could
the underlying database look nothing like the cake Controller/Model
representation of the system?
I know the models can use any tables you tell them to but is this just
for peculiar situations, or is it common/acceptable (even expected)
that the database may look completely different to the Model?
I'd appreciate any comments.
Cheers,
Sonic
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---
