[Catalyst] App design questions
Marcello
m.romani at spinsoft.it
Wed Aug 17 19:10:49 CEST 2005
Simon Miner ha scritto:
>
> -----Original Message-----
> From: catalyst-bounces at lists.rawmode.org
> [mailto:catalyst-bounces at lists.rawmode.org] On Behalf Of Marcello
> Sent: Wednesday, August 17, 2005 11:00 AM
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] App design questions
>
> David Storrs ha scritto:
>
>>On Aug 17, 2005, at 9:42 AM, Marcello wrote:
>>
>>
>>>Simon Miner ha scritto:
>>>
>>>
>>>>Hi,
>>>> When writing a web site using Catalyst, is it better to use one
>
> big
>
>>>>application with many controllers, or several smaller applications
>>>>with fewer controllers in which each app is broken down by function
>
>
>>>>(i.e. order, search, etc.)? In the scenario I am considering, the
>>>>site functions are somewhat distinct, but the underlying models are
>
>
>>>>shared between them. What are the pros and cons of each approach?
>>>>
>>>
>>>Well, since the "models" are shared, I would say the natural
>
> approach
>
>>>is one model (i.e. one database and an ORM package) and several
>>>controllers, each of which deals with a particular set of related
>>>functions.
>>
>>
>>I think he's saying that the framework models (the Cat::M::<name>
>>modules) are shared, whereas you are saying that the pattern Model
>
> (the
>
>>'M' in MVC) is shared.
>>
>>Correct me if I'm wrong, either of you.
>
>
> Since the OP wrote "writing a web site" I assumed he was referring to *a
>
> single website*, that's why I did not understand what that "several
> smaller applications" was about.
> After reading your reply and Alexander's, and re-reading the OP, I'm not
>
> entirely shure I fully understand it :-)
> He talks about "site functions" and "underlying models", so maybe he was
>
> referring to a "web site" as a "hosting location" where you have
> multiple websites sharing common functional modules (I would call them
> catalyst plugins... ) and probably some of the database structure.
>
> At this point I think the OP should clarify...
>
> [Simon Miner] By "web site", I meant a single web site at a single
> hosting location, The site is a large e-commerce site that allows users
> to do a bunch of different things like search for products, create user
> accounts, and place and view orders. These are the "functions" I
> referred to, and they are the things I was wondering about splitting out
> into separate Catalyst applications, since it can be argued that each is
> its own logical system.
>
> However, it seems that the general feeling is that a
> one-app/many-controller approach is best for using Catalyst. Correct me
> if I'm wrong here.
>
I think you are right about the general feeling.
All in all, if those "functions" are so complex that they could
conveniently be split into separate catalyst applications, I don't see
why you should not do it.
However I see plenty of room for problems/headaches in the fact that the
e-commerce site is *one*, therefore some parts of the database schema
must be accessed by more than one "function".
You end up having to cut-n-paste some of the classes in the "model" part
(i.e. the 'M' in MVC) among some or all of those applications.
Or maybe it's just me not seeing a better way to deal with shared models.
Marcello
More information about the Catalyst
mailing list