Sonic Baker <[EMAIL PROTECTED]> wrote: [...]
> When this Model is a mapping of a relational database we end up with a lot
> of ModelA->ModelB->ModelC etc...
> To me this suggests high coupling between objects and I can't seem to stop
> myself ending up with such a design. So my question is, what's the best way
> to go about a high cohesive design with cake.

Do your model objects actually know anything about the internal 
structure of the other objects beyond being Model objects?

Generally, mine only know that they are associated with some other 
objects, which seems sort of unavoidable when representing a relational 
database.  The model methods and so on are the ones named in AppModel, 
so other Model objects only know that it's a Model, really.  I doubt 
that's high coupling, as each model can change without requiring changes 
in the other, as long as it still has an id. It's only if the model goes 
away or changes name that a change is *required* although performance 
may make changes *desirable*.

So, for high cohesion, use the AppModel methods and add other ones 
sparingly (and probably only use them from its Controller, which seems 
often unavoidably coupled to the Model).

Have I misunderstood?

Best wishes,
-- 
MJ Ray <[EMAIL PROTECTED]>  www.ttllp.co.uk  +44-870-4321-9-10
Web, localisation, koha, databases, GNU/Linux and statistics.
Registered in England and Wales, partnership number OC303457

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to