The only advice I can give is know the three tools you have.

1.  Define the assocation in the model file.
2.  Define associations on the fly with $this->ModelName->bindModel
3.  Set the recursive parameter from 0 to whatever depending on how
many levels deep you want to retrieve (the manual only mentions to 2,
but I have some that I want to go to 3).

Now that you know what tools you have it is up to you to choose how you
should use them in order for them to work best.  I have a blend of all
three as I assume you will.

For instance, in one of my models I use the foreignKey of the record to
retrieve a selectTag generateList.  For what I am doing I don't need
the association on all the time.  However, when I am logged in as
administrator I want to use the association.  So, I have a beforeFilter
that checks for the $this->params['admin'] to be set and then
bindModel() the association.

When I want to list something I usually will set recursive to 0 or 1
before the read call.
$this->ModelName->recursive = 0. (Check API for what methods accept it
as a parameter).  But when I do that I like to make the call
($criteria, $recursive = 0) just so I know what that nondescript number
stands for when searching thru my code.

So, the concern is real.  But for truly large scale applications you
would be more concerned about using all those server technologies to
distribute your load across multiple servers and have your MySQL
installation on another server setup to be a three tiered application,
etc. etc.


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