MVC advice..?

2002-05-29 Thread Rafiq Ismail (ADMIN)
Hi, I'm building an MVC architecture site and have hit a design issue. I have varoius Control subclasses which relate to different templates with different behaviour. Now my problem is that I have to assign which Subclass I want to instantiate, based on the script and params. I my last effort

RE: MVC advice..?

2002-05-29 Thread Aaron Ross
Is there a neat way of dynamically loading in the appropriate control subclass? Something proven and widely used. For what it's worth, I use the eval trick too. Although it may seem a little clunky, I believe it is proven and widely used. The DBI.pm module uses code like this to load in the

Re: MVC advice..?

2002-05-29 Thread F . Xavier Noria
On Wed, 29 May 2002 09:22:00 -0400 Aaron Ross [EMAIL PROTECTED] wrote: : Is there a neat way of dynamically loading in the appropriate control : subclass? Something proven and widely used. : : For what it's worth, I use the eval trick too. Although it may seem a : little clunky, I believe

Re: MVC advice..?

2002-05-29 Thread Perrin Harkins
Rafiq Ismail (ADMIN) wrote: Now my problem is that I have to assign which Subclass I want to instantiate, based on the script and params. So, you're asking how to map URLs to perl modules? Is there some reason you aren't simply using httpd.conf or Apache::Dispatch? In my last MVC design,

Re: MVC advice..?

2002-05-29 Thread Rafiq Ismail (ADMIN)
Ello, On 29 May 2002, Randal L. Schwartz wrote: Rafiq == Rafiq Ismail (ADMIN) [EMAIL PROTECTED] writes: Rafiq Is there a neat way of dynamically loading in the appropriate control Rafiq subclass? Something proven and widely used. Load the file with a require, and then just call the

Re: MVC advice..?

2002-05-29 Thread Perrin Harkins
Dave Rolsky wrote: On Wed, 29 May 2002, Perrin Harkins wrote: There's no good reason to do an eval 'use'. Use require instead, and import if you need to (but most people don't). Actually, there is. This code: my $module = 'Foo::Bar'; require $module; is not the same as

Re: MVC advice..?

2002-05-29 Thread Perrin Harkins
Rafiq Ismail (ADMIN) wrote: I'm not so keen on loading all the inheriting classes into memory beforehand You really should do that, because it will save overall memory by increasing the amount of memory that's shared. All modules should be loaded during startup in the parent process. It's

Re: MVC advice..?

2002-05-29 Thread Dave Rolsky
On Wed, 29 May 2002, Perrin Harkins wrote: There's no good reason to do an eval 'use'. Use require instead, and import if you need to (but most people don't). Actually, there is. This code: my $module = 'Foo::Bar'; require $module; is not the same as this: require Foo::Bar; If