An introduction to ENGINE::MVC

malte on 2003-04-01T14:11:35

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...


CGI?

Matts on 2003-04-01T16:05:11

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.

Re:CGI?

malte on 2003-04-01T16:49:28

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 .

MVC

bart on 2003-04-02T10:57:53

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?

Project Information

elusion on 2003-12-07T21:43:15

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

Re:Project Information

malte on 2003-12-08T08:20:42

It is not public, but I could send you the code to play around with it.

My eMail is ubl _ at _ schaffhausen.de