[Catalyst] Dispatching based on path and host/domain

Matt Pitts mpitts at a3its.com
Tue Apr 22 14:42:21 BST 2008


> -----Original Message-----
> From: Matt S Trout [mailto:dbix-class at trout.me.uk]
> Sent: Tuesday, April 22, 2008 9:12 AM
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Dispatching based on path and host/domain
> 
> On Tue, Apr 22, 2008 at 10:22:55AM +0100, Curtis Fletcher wrote:
> > > -----Original Message-----
> > > From: Matt Pitts [mailto:mpitts at a3its.com]
> > > Sent: 22 April 2008 03:06
> > > To: The elegant MVC web framework
> > > Subject: RE: [Catalyst] Dispatching based on path and host/domain
> > >
> > > > You've probably heard this before on the list, but...
> > > >
> > > > Ideally, you shouldn't have enough code in your Controllers
> > > to justify
> > > > "sharing" the app across domains that need different
> functionality.
> > > The
> > > > meat of the app should be in the Models, then you can just run
> > > multiple
> > > > Cat apps - one with Cart controllers and one without - that use
> the
> > > > same
> > > > "shared" Models.
> 
> Disagree. Just because you want to minimise code in the controller
> doesn't
> mean you don't want to consider this to be the 'same app'.

Unless one is specifically looking to white-label an app, different
functionality across different domains means "two apps" to me. What
happens when domain1.com gets bought out and they want to rebrand, or
worse just a tarball of all the code behind their site? Yucky stuff if
you're running in the 'same app' as domain2.com.

> You're making a valid design point, but then jumping from there to an
> invalid one by ... well, handwaving so far as I can see.

I would add the caveat that if the two domains are for the same client
or are *completely* internal to my company, then I'd consider running it
as "one app". Otherwise, I'd rather maintain two separate apps and some
common Models than do a lot of dispatch kludging to provide different
functionality.

v/r
-matt pitts



More information about the Catalyst mailing list