Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

malte (1708)

malte
  (email not shown publicly)
http://joose-js.blogspot.com/

Working on Joose JavaScript meta system (Blog) [blogspot.com] and blok [appspot.com], a web based application for collaborative ui prototyping.

Journal of malte (1708)

Tuesday April 01, 2003
09:11 AM

An introduction to ENGINE::MVC

[ #11369 ]

There are many frameworks for building dynamic websites in Perl (Mason, Embperl, etc) and here is yet another one:

ENGINE::MVC

ENGINE because I once thought all caps package names were cool and now it's too late to change that all over the place and MVC because that's the abbreviation for Model, View, Controller.

The framework tries to make writing MVC-based in an perlish manner easy. A typical application looks like this:

our $Controller; # Singleton

use ENGINE::MVC;
use ENGINE::MVC::Controller

    edit_document => {
        model    => "Customer::Project::Component::Edit::Model",
        view     => "Customer::Project::Component::View",
        template => "document_edit.tt2"
    },

    delete_document => {
        model    => "Customer::Project::Component::Delete::Model",
        view     => "Customer::Project::Component::View",
        template => "document_delete.tt2"
    }
;

my $q = CGI->new;
$Controller->execute($q);

At compile time a controller object is created and initialized. certain actions (qw/edit_document delete_document/) are associated with a model class, a view class and a template.

At runtime the controller is executed with the current query.

...to be continued...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • It seems your MVC framework is tied to the web. Shouldn't it thus be CGI::MVC?

    Can you untie it? Might be useful to GUI developers in all sorts of environments.
    • It's really tied to an object, that understands the param method.

      That's one of the shortcomings in the current implementation (It can't run under native mod_perl, only Apache::Registry).

      Besides that it could be used in any environment that isn't fully interactive / any system that resembles the request/response model of web applications .

  • I thought it ment Microsoft Visual C(++), but perhaps that should then be MS-VC++. The association with MFC (Microsoft Foundation CLasses) also plays a role in this association.

    Still, it's not really the same name... is it?

  • You've got a bit of information here on your journal about ENGINE::MVC, but is there any more anywhere? Any code? I'm googled for it and found nothing. It looks like something I might like to play around with.

    elusion