SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Classic MVC
-
Jun 11, 2007, 08:47 #1
- Join Date
- Feb 2006
- Posts
- 281
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Classic MVC
Can some one post an example of classic MVC. I have heard there are many variations of MVC. I don't think there is a classic style version posted in these forums.
-
Jun 11, 2007, 11:49 #2
There is no MVC.
MVC is abstraction. It is a state of mind. A state, that widens your ability to cope with more and more code.
Some will say MVC is separation of Business Logic from Data Storage and GUI Display. But yet it is an abstraction. And everyone can have a personal grasp of it, that suits him best.
So I don't think there is a "classic" approach.
-
Jun 11, 2007, 12:50 #3
- Join Date
- Jun 2004
- Location
- Copenhagen, Denmark
- Posts
- 6,157
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
MVC was originally conceived in a desktop application environment. This design doesn't map very well to the stateless, client-server model of web applications.
-
Jun 11, 2007, 14:09 #4
- Join Date
- Aug 2004
- Posts
- 428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
stateless by default yes.
depending on the framework you have many ways to perserve state.
for application level, user level, page level, request level,
application level - appdomain, can be simulated with database and code.
user level using sessions
page level using viewstate [asp.net or php prado]
request level well that goes back to stateless
i'm not to fond of some of the frameworks sprouting all over the php community...
you want classic. study design patterns and look into prado (seperates your page template from content and seperates presentation from logic for each page --- that in my opinion is already a good start. and they implement a provider model.. look in the asp.net section here on sitepoint i just finished writing a thread concerning the provider model.).
-
Jun 11, 2007, 16:46 #5
- Join Date
- Feb 2007
- Posts
- 1,274
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The classic is here.
Most web MVC frameworks represents a devaluation of the original MVC concept. As you can tell from the original (smalltalk-80) MVC, the view is stateful, there are multiple, nested views each with an associated controller, thus multiple controllers. The view (and subviews) can query and subscribe (termed "depend" in the paper) directly on the model.
The so-called MVC patterns of Rails, PHP Symfony, etc. have single, monolithic controllers, the controllers are hand-feeding pieces of the model to the view, which again is merely just a rendering procedure rather than an object.
Part of the value of design patterns is terminology. When I say "visitor" you are supposed to know what I am talking about. Sun was the first to confuse the original MVC pattern with the "model II JSP approach".
Now, the design pattern used by Rails, Symfony etc. certainly have merits. Rails in particular have proven it to be an effective design. It is just not MVC as it was originally conceived. It is just more a model-controller-renderer (MCR) pattern.
Does it matter? Hell yes, thanks to Sun, Struts and Rails there is now widespread confusion about what exactly is MVC. The type of confusion a common terminology should help avoid. Thanks!
Maybe classic MVC is not for the web. After all it was developed for (stateful) interactive graphical user interfaces. But then again, with AJAX we are seeing more interactivity with an eerie resemblance to GUIs.
Bookmarks