in reply to Re: Trying to understand Catalyst::Model::Adaptor
in thread Trying to understand Catalyst::Model::Adaptor
thanks for your reply. I think I might need to clarify my question a bit. I don't doubt the MVC pattern itself and I don't want to put business logic inside the controller and . In my example, my business logic is in NonCatalyst::MyClass, i.e. it is completely separate from the controller and the WebApp itself. The controller simply collects data and asks this model class for a result, which it then sends to a view.
My question is, what do I gain from using the Catalyst::Model::Adaptor approach to declare my external class as a model as opposed to simply requiring it in the controller and using it directly. If anything, the Adaptor approach appears to require more code, especially when parameters need to be send to the model.
In addition, my case requires that the model is instantiated once per request (it needs to connect to third-party databases depending on user input), so I would have to use Catalyst::Model::Factory::PerRequest and I can't really see the benefits of that at the moment but I'm new to Catalyst and fully aware that I might be overlooking something here. Thanks for your help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Trying to understand Catalyst::Model::Adaptor
by Your Mother (Archbishop) on Apr 06, 2010 at 17:38 UTC | |
by tospo (Hermit) on Apr 07, 2010 at 08:14 UTC | |
by Your Mother (Archbishop) on Apr 07, 2010 at 15:52 UTC | |
by tospo (Hermit) on Apr 07, 2010 at 20:54 UTC | |
by Your Mother (Archbishop) on Apr 07, 2010 at 22:37 UTC | |
|