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


in reply to Re^2: Migrating database field values rules from Perl code to DB
in thread Migrating database field values rules from Perl code to DB

if the discussion is about putting code in your DB that apps should SELECT out and then run arbitrarily, I'd agree with you on moral grounds -- but there are lots of situations where the "data" for one application is "constraints" for another application.

CMSs are a great example of applications where the person writing the application doesn't know what kinds of constraints the end user needs for their data, because the "content" is different for each installation -- so the "adminstrators" of the system enter the constraint data, and the "users" of the system enter the content that conforms to those constraints.

Surely you wouldn't suggest that everyone who wants to install/maintain a complex application needs to write code to define how they wnat to allow others to use that application? you might rgue "that's what configuration files are for." but how is puting that information in a configuration file really any different then putting it in a database?

  • Comment on Re^3: Migrating database field values rules from Perl code to DB

Replies are listed 'Best First'.
Re^4: Migrating database field values rules from Perl code to DB
by dragonchild (Archbishop) on Feb 12, 2007 at 21:24 UTC
    That's an apples'n'oranges distinction. "administrators" of a CMS are users of that CMS. The developers are meeting their user requirements.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

      That's exactly my point. your comment: "Any time you want to start putting application constraints into a database, you should stop thinking and just do the simplest thing possible. That will, most likely, not involve a database." is too general, because it doesn't take into account the fact that in many, MANY, cases the constraints are data (to someone).

        How many CMSes (and similar applications that have user-admins) are created as opposed to standard CRUD / BREAD / reporting applications? My back-of-the-envelope is that it's probably at least 1:1000 and I'm probably underestimating the ratio by at least a couple zeros. Most applications are not meant to be installed, especially ones written in Perl.

        Furthermore, the need for dynamic configuration is often overestimated. A simple config file that's loaded on startup is good enough for 99% of all configuration needs.


        My criteria for good software:
        1. Does it work?
        2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?