MVCR pattern (was Re: [Catalyst] Bing!)

David Storrs dstorrs at dstorrs.com
Thu Aug 11 06:13:20 CEST 2005


On Aug 10, 2005, at 11:56 PM, Randall Marbach wrote:

> Those dang Java and GoF Guys... maybe its time for a
> twist on the MVC pattern ( ala TIMTOWTDI).. we need a
> MVCR pattern where R is rules, or possibly MVCP where
> P is Process, such as in BPEL4WS, which is a XML
> Language for orchestrating a bunch of business
> processes, rules, etc, independant of UI,presentation
> or persistance issues.
>
> Just a thought, no more Margaritas for me tonite..
>
> Randy

(As an aside:  I don't believe the GoF invented the MVC pattern.   
It's been around since the days of Smalltalk at least.)

As to MVCR...you know, that's a really good point.  All this  
confusion about where the business logic goes should be a big red  
flag saying that it does not properly fit in /any/ of the three  
locations.  It really should have its own segment...at least in theory.

In practice, I'm not sure how that would work.  As I build my app, I  
am finding that things are even blurrier than I expected....

What are people putting in actions of their View classes?  Just a $c- 
 >stash->{template} = 'xyz.tt'; line?

What about the Controller?  Personally, I have chosen to put my  
business logic in the Controllers, so their actions tend to be big.

The Model?  Again with the personal--my Models are thin wrappers over  
the DB.  They have no actions aside from the ones defined by  
C::M::CDBI(::Sweet)?.

If we could identify the 'best practices' for what goes in each,  
whatever is left over would be the Rules segment.

And, of course, figuring out the BPs would be useful in and of itself.

--Dks



More information about the Catalyst mailing list