[Solar-talk] Composite views

Paul M Jones pmjones at ciaweb.net
Sat Nov 3 08:05:09 CDT 2007


On Nov 2, 2007, at 11:20 PM, Robert Gonzalez wrote:

> Paul M Jones wrote:
>>
>> On Nov 2, 2007, at 6:19 PM, Rodrigo Moraes wrote:
>>
>> I would argue that invoking any sort of business logic from the  
>> view is probably not a good idea.
>
> I agree with this. Business logic is meant to be handled in the  
> model (isn't it?) and view logic handled by the view. I would  
> consider the inclusion/parsing of components at the display level  
> the responsibility of the view, then it would seem that the actual  
> parsing of the business logic would best be suited for a model type  
> snippet.

You're right, but I want to extend on that a little to be clear.  If  
the view calls an object for presentation, and that object calls  
another model or controller, that means the view has (indirectly)  
invoked some business logic.  I think that's not so great; no model  
or controller should receive any more activity by the time you hand  
off to the view.

Otherwise, yes, I'd agree that data-manipulation logic goes in the  
model (for strictly "business" logic) and/or the controller (to  
coordinate with the view).

Hope that's helpful.  :-)


--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the Solar-talk mailing list