Re: Object validation classes

From: Mike Kienenberger (mkienen..laska.net)
Date: Mon Sep 15 2003 - 10:34:15 EDT

  • Next message: Mike Kienenberger: "Re: Plans for 1.1 and after...."

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > 3. One very important piece is not implemented, or at least I am not
    > seeing it - CayenneDataObject.validateForSave(..) - this is where a
    > DataObject should pull entity info and check things like max length
    > exceeding the allowed value, nulls where nulls are not allowed and
    > such...
    >
    > An alternative to 3. and 4. would be using class generation to create
    > validateForSave for each class, but for now I am still unsure if this
    > is the way to go. Doing too many things via class generation is a
    > conceptual shift in Cayenne and requires more thought.

    Since validation on save is a universal requirement, it should be inherent
    in the framework rather than put in as application-specific code (which is
    what class generation is -- application-to-framework glue).

    My suggestion is to keep the class generation as "empty" as possible so that
    individual applications can customize it.

    For instance, I have specific business requirements that force me to log all
    database transactions in a specific way. I can (and have) implemented that
    as a custom class generation template, but that functionality is specific to
    my application.

    I would not want to have to rewrite that code simply to gain
    "validateForSave" nor any other framework bug fix or feature addition.

    -Mike



    This archive was generated by hypermail 2.0.0 : Mon Sep 15 2003 - 10:29:57 EDT