[Catalyst] Re: MVCR pattern (my 2 cents of flame, rant, & vocabulary)

Dominique Quatravaux dom at idealx.com
Thu Aug 11 18:10:56 CEST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Storrs wrote:

>
> Well, as you say, it doesn't match either the historical or the
> modern usage


I have to nit-pick a bit here. Our most venerable c2.com
(http://c2.com/cgi/wiki?ModelViewController) is far from reaching a
consensus on the "historical" definition of Model-View-Controller,
except if what you mean by that is the Smalltalk doctrine.
Unfortunately Smalltalk treats MVC mostly as an object-oriented
pattern (View being an Observer of Model, requirements on inter-class
coupling and control flow), which is ideally suited to GUI apps but
not relevant for the Web except if you twist your mind and flow
control badly enough (serializable continuations). IMO there is more
to MVC than a montage of classes, it's more of a philosophy (a Trinity
perhaps - Model being the Father, View being the Son and Controller
the Holy Ghost? Ha ha, only serious...)

Conversely, some (all?) instances of Smalltalk do not have to deal
with persistence whatsoever because it's handled by the language
runtime in a transparent fashion. It proves to be a much bigger issue
with Perl web apps, partly because of the SQL tabular view of the
world which isn't terribly OO, and also because more complex languages
are typically more difficult to persist properly.

<flame pants="on">

And as regards the "modern" part of it, c2.com is summing it up oh so
nicely... (http://c2.com/cgi/wiki?MvcIsNotObjectOriented):

> I think the way MVC is implemented in J2EE applications using JSP
> is not very OO. You are placing your data in objects called Beans
> that represent the View layer and have no logic and are therefore
> nothing but data structures. All of your logic goes into the part
> that is usually considered the Model layer, but there is more logic
> in the Controller layer, so people get confused about what belongs
> in the controller layer and what belongs in the model. But to me,
> the idea of separating data from code and putting it into dumb data
> structures is not very OO. --WillCardwell
> <http://c2.com/cgi/wiki?WillCardwell>

In other words: the very fact that there *is* a controversy on what
"modern" MVC means, may be nothing more than yet another thinko from
the would-be Java software architect crowd >:->

</flame>

Sorry about that, but I do feel better now...

Let's get pragmatic again. Perrin is IMHO successfully arguing the
need for a clean separation between stuff-that-is-useful-in-crontabs,
stuff-that-draws-pictures-blasts-out-HTML-whatever and
stuff-that-holds-everything-together. While we are at it, we could
call those stuffs respectively M, V, C and call it a day. Maybe M can
be further cut out between MP (persistence) and MB (business), I don't
know... But I have been doing various kinds of GUI-oriented apps for 4
years now (web or not, Perl or not, SQL or not) and I have found the
above definition of MVC to be a useful, reliable and extremely robust one.

- --
Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC+3iPMJAKAU3mjcsRAueWAKCfQvDsuzdiPUA97L8CYpxilxW84ACcCLjt
u+kxAN86d0jfQGU2xV7oeIM=
=AH1c
-----END PGP SIGNATURE-----





More information about the Catalyst mailing list