Hi Nate,

I knew you'd answer this one :)

On 3/21/07, nate <[EMAIL PROTECTED]> wrote:
>
>
> First of all, the coupling would not be any looser even if you used
> objects.  The component would just be tightly coupled to an object
> property instead of an array key.  Second of all, this is what
> afterFind is for.  If you have to make a database change which impacts
> your code, you can use afterFind to act as an intermediary, and alter
> the data before it goes elsewhere in the application.


Ok, so this will cut out the need for altering the controller action. I
haden't thought of afterFind(), thanks for the tip. So basically  you're
saying that it doesn't matter. Passing an array means that if the API four a
component expects an array then it is up to the programmer to set the input
as the API requires. At least this was what I was thinking but I just
thought there might be a more flexible way for a component to extract it's
parameters.

Third of all,
> since you always writing unit tests for your application, you will
> always know exactly what breaks and where if you make a database
> change.  You are using unit tests.... aren't you?


Of course! How could you even ask me such a thing :)
Even thought the tests will catch such things, they just show me how coupled
the system is, they don't prevent coupling, although proper TDD may help
reduce it.

Thanks for your response,

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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to