in reply to OOP design related question.

As I understand you want to make db related calls from your Controller. Why don't you encapsulate the DB calls in a separate perl module ? You could have this:
  1. YourApp::CGI::User - the controller
  2. YourApp::USer - the model class
Your controller would validate the data (via Data::FormValidator) and invoke methods in the model class to check the user/session in the db. The the db handler could reside in the model class.

Replies are listed 'Best First'.
Re^2: OOP design related question.
by techcode (Hermit) on Sep 09, 2005 at 20:17 UTC
    MCV - actually that might be the reason why I posted this question. I was thinking if there is some way things like this are done. As I'm not too familiar with MCV so I wouldn't know?

    This would also answer questions of few others...

    As I use sessions to see who's logged in, usually connection is made (in cgiapp_init sub of main module which is called before anything else is executed) on start-up. So I'm not sure if what you are proposing is possible? Anyway the disconnect is called by destructor of my module (DBIx::Handy)...