http://qs321.pair.com?node_id=508104


in reply to Re: Catalyst : Observations After Week 1
in thread Catalyst : Observations After Week 1

I don't really consider that MVC. (It's just a pattern, so if that works for you, great! However, in my experience it's not the right approach.)

Say more, please!

Would you suggest this should live in the model, so other non-web-apps can call $obj->give_raise(or whatever) and for free get the logic ("no raises to fired emps", for example)?

Suggestions?

water

Replies are listed 'Best First'.
Re^3: Catalyst : Observations After Week 1
by chromatic (Archbishop) on Nov 13, 2005 at 17:43 UTC

    Yes, exactly that.

    I once maintained a reporting application that pulled data from a multi-application database. There were no constraints or integrity checks in the database or the applications people used to enter or edit data.

    One day in 2003, my contact at the customer called me to yell that the report listed records from 2005! I told her that the reporting program had no hard-coded dates in it and that the errors came from her database. I also gave her a single SQL query to run to prove it. I'd previously given her another small application to find and correct as many data errors as safely possible -- and there were plenty.

    Granted, calling any of the applications MVC is a real stretch. Still it is painfully obvious that putting business logic (you can't add a record with a date in the future) where other applications can't reuse it can cause plenty of trouble.

    Of course, if you know that you'll never ever access your data with any other application ever, go ahead.