in reply to Why I dislike the MVC implementations in Web

In Struts, there's some confusion/disagreement about which part of MVC the ActionForm beans belong to. The official documentation puts it in the Model part, but also says it should be considered as part of Controller. I always consider it as part of the View. With the ValidatorForm and the various taglibs, I would consider the combination of JSP/taglib and ActionForm to be a reasonably good View component.

In perl frameworks, I've only used CGI::Application with TT2, and ValidateRM. The only one I miss is the equivalent of taglibs (those in the Struts html namespace). I heard TT2 can/already do that.

  • Comment on Re: Why I dislike the MVC implementations in Web

Replies are listed 'Best First'.
Re^2: Why I dislike the MVC implementations in Web
by ruoso (Curate) on Jun 07, 2005 at 21:00 UTC

    The question is that if you have a template to represent the entire page (including the inputs), you can't actually reuse complex inputs. Because something is missing *before* the validator to put the pieces together of the complex input. Think in a datetime field splitted in:

    ___/___/___ __:__:__
    

    This means six input fields representing a single value. The validator (AFAIK) expects a complete value, not the tiny bits of it.

      Of course you can reuse them. There is a certain amount of coordination required between the HTML and the code that parses the input. Your component model will not change that.

        Actually, I didn't understand. The component model is just about creating a Class (called component here for following a bigger pattern) that puts together both the rendering and the processing of the input.

        An example of the version 1 of the Perl Oak (which doesn't use template yet, but it just could use) demonstrates that. The following component just encapsulates the render and the processing together....

        Code for Oak::Web::HTML::Input

      If you wanted to you could do that bit in JavaScript and send it as a 7th parameter, so the code would still be part of the view...

        Yes, but that would solve just this example, not the problem at all...