Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: CGI::Application

by james2vegas (Chaplain)
on Aug 23, 2009 at 21:51 UTC ( #790691=note: print w/replies, xml ) Need Help??

in reply to Re: CGI::Application
in thread CGI::Application

That sounds like Database plus ORM to me, especially one like DBIx::Class, where you can extend default DBIC classes to add transformation and validation (beyond what your database provides), or any other business process.

Replies are listed 'Best First'.
Re^3: CGI::Application
by astroboy (Chaplain) on Aug 23, 2009 at 22:10 UTC
    Not all of your business logic (model) is necessarily DB related or should be part of your ORM. You might have to do things like FTP files, perform LDAP lookups and a myriad of other things. If you simply use your ORM in your controller (and a lot of web apps do this), then you've lost the ability to reuse your code outside of your CGI::App controller. (e.g. your boss or marketing dept now decide you need a batch or a SOAP interface to the same business logic, but your existing logic isn't reusable because it's all in the controller)
      A model should only be the representation of the data and domain logic, the view should only be a rendering of the model data and the controller should respond to events and trigger changes in the model. Given that, sometimes a thin extension over the ORM is sufficient for a model, sometimes you need much more, but CGI::Application doesn't force you to a specific model system, and that is a good thing.
        I absolutely agree it does not force you to use a specific model and that that is a good thing. But neither does it provide an off the shelf solution (let alone two or three) for the model space. There are also many modules which can be optionally used with CGI::Application but the data about whether they are any good is rather thin. That was my original point.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://790691]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2023-09-24 18:00 GMT
Find Nodes?
    Voting Booth?

    No recent polls found