[Catalyst] App design questions

Marcello m.romani at spinsoft.it
Wed Aug 17 15:42:34 CEST 2005


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. E.g. the authentication controller could containt the login 
and logout method, the shopping cart controller could containt the 
insert_item, delete_item, display_cart, etc.

I don't really understand why one would implement a website using 
multiple applications...

> 
>  
> 
> Also, I am noticing that in the Catalyst examples, the view MVC layer 
> sometimes contains logic that some might think better suited for the 
> controller.  For example, the HOPS and Scaffolding apps have calls to 
> the Class::DBI retrieve_all methods With regard to MVC, should this 
> database call be in the controller? If I wanted to change the UI, it 
> seems like this process would be made more complex by the presence of 
> such code in the view layer.  Are their processing considerations for 
> setting things up the way that they are? (I’m no MVC purist, mind 
> you…just curious.)

If you search this mailing list archives you'll find interesting thread 
about this subject.

> 
>  
> 
> Thanks.
> 
>  
> 
> - Simon
> 
> -----------------------------------------------
> 
> Simon Miner
> 
> Applications Engineer
> 
> Christianbook.com
> 
> **E**: sminer at christianbook.com <mailto:sminer at christianbook.com>
> 
> **T**: (978) 573-2233
> 
> **F**: (978) 573-8233
> 
> -----------------------------------------------
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst




More information about the Catalyst mailing list