A A A i

billet précédent :: billet suivant

The MVC litany goes on

Today on Javablogs, another post with "MVC" in the title: Bashing MVC. The short entry seems relevant, until the last sentence: If MVC is really bad then why framework like struts are so famous?. Another loss, Struts is not about MVC. After 3 years of Struts and almost five years after the infamous Understanding JavaServer Pages Model 2 architecture - Exploring the MVC design pattern, it should be clear that Model2 has almost nothing to do with MVC. Model: the ActionForms, why not. Controller: the Struts Servlet, only one Controller for the application? In regular MVC you've got one Controller per widget! View: JSP? If it was MVC, the View would be in the client browser: HTML, JavaScript, Applet, Flash, whatever, but not the JSP themselves which are only procedures generating some flat files. And there is more in MVC than the "three components". Where is the "Model notifies the View" mechanism? Does Struts does something to update all the client screens when an ActionFom is updated? First you have to grab a handle on those ActionForms, which by default only live the time of the request processing. Where is the hierarchy of Views (and thus the hierarchy of Controllers) for handling the users inputs? This can last long.

Today, many of the young Java developers start doing web applications, and they are told that Struts is MVC. When they start doing some stuff with Swing, they are told it's easy, because Swing is MVC as well. And they fail to understand why there is no magic XML file with the navigational aspects, why there is nothing to magically call their 'execute' methods, why their Form are completely useless. They'll discover the wonders of notifications, and the richness of heavy clients. Eventually, they hopefully will have forgotten Struts, or they will realize that it's probably nothing more than the Command design pattern reachable through an HTTP request.

Update: Andy Wardley says it better here.(Cyberpunk, 2004/11/15 18:02) lien permanent

Commentaires ici et ailleurs :

True MVC web development can be achived with framework like Echo : http://www.nextapp.com/products/echo/
But then, you have a web application, which is far from being a web site.

Posté par Lunar, le jeudi 21 octobre 2004 à 11:05 #

Still evangelizing people about why Struts can't be called an MVC :-)

Posté par Florent, le mardi 26 octobre 2004 à 12:06 #

Always fighting for the truth ;-)

Posté par Damien B, le mardi 26 octobre 2004 à 17:13 #

Les commentaires pour ce billet sont fermés.


qui est

nom : Damien Bonvillain
courriel : kame à cinemasie.com
bloggercode:
B9 D+ T+ K S F I- O X+ E- L- C-- Y1 R+ W- P+ M5 N-- N+
un peu plus : Google Whoring tortue

Messagerie instantanée

    les koms

    m'enfin

    Quant à mes invectives imaginaires, je vous laisse chercher un endroit adéquat pour les ranger. Elles craignent la lumière, si vous voulez une piste.
    Lien associé
    Eolas - « Aimez moi, c'est un ordre. »

    les bons vieux


    archives

    « novembre 2004 »
    lunmarmerjeuvensamdim
    1234567
    891011121314
    15161718192021
    22232425262728
    2930

    XML RSS 2.0 XML RSS 2.0 commentaires A A A i

    liens

    allégeance

    Blog sans chat

    colophon

    Propulsé par pointClairMerci à la caféineDevelopment with EmacsBadges from GTMcKnightFreeListed on BlogSharesGeoURL