Hi Richard,

I think you're still confusing what we refer to as the driver (the
Controller in MVC) and the model classes (the Model in MVC).

It looks like you're tying yourself in knots, so step back from what
you've done so far and read through the tutorial by simon cozens :
http://www.aarontrevena.co.uk/opensource/maypole/maypole-tutorial.pdf,
or the other articles at http://maypole.perl.org/?Tutorials.

Once you've read those and cleared up the confusion about the basics
come back to using Maypole with C::DBI classes.

The only difference in using your own C::DBI classes vs using those
generated, is that you call setup with the class names instead of a
database connection.

So..

You have a driver class that drives/controls the application, it is
your mod_perl handler. If using CGI scripts it is a cgi script.

In that class (if using mod_perl, otherwise cgi script) you :
* specify the configuration (path to templates, etc)
* specify the type of data model used ( Maypole::Model::CDBI::Plain)
* setup the model classes you want to use/
* authentication / authorisation, etc

You can specify how to untaint/validate data :

Application::Foo->untaint(...);

You can also specify actions for your data classes i.e.

Application::Foo actionname :exported {
..
}

You don't need to touch your C::DBI classes at all.

Hopefully that makes it clearer.

Some quick points regarding Dave's post :

You DON'T need to put actions in your classes, you only need to ensure
they are declared in that classes namespace - i.e. sub
classname::methodname. You can do this either in a driver/controllor
class, cgi script or you can group the actions together in a class and
'use' it in your driver/controllor class.

You don't need to make your model data classes inherit from
Maypole::Model::CDBI::Plain - the module will 'adopt' them when you
call setup in your driver class.

A.


--
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting


-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to