Hi there,
I've was reading an article (www.jmock.org/oopsla2004.pdf) the other day and came across an section in which there was a warning about code which goes along the lines of the following:
dog.getBody().getTail().wag();
This is known as a "Train Wreck". It said that this was bad because this one line depends on the interfaces and implied structure of three different objects.
I was wondering if this was the same as calling a Model in cakePHP through a series of it's associations, e.g. $this->Dog->Body->Tail->wag();
I know I could just put 'Tail' in the $uses[] array of the controller but my understanding of the $uses array is that it's purpose is for calling methods from unrelated models. Am I misunderstanding the Train Wreck scenario or does it not apply in the case of cakePHP since the models above are related via associations?
Any comments will be greatly appreciated.
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
-~----------~----~----~----~------~----~------~--~---
