Re: Object validation

From: Dirk Olmes (dirk.olme..mx.de)
Date: Mon Sep 01 2003 - 03:33:12 EDT

  • Next message: G.Venu : "deleting a row"

    >> The static method does what I need for now, I just need to
    >> remember to call it and I tend to forget these things :-)
    >> But anyway, I believe Cayenne should support some kind of
    >> validation. What's the best way to do it? I don't know. I agree with
    >> the suggestion of copying this static method to the beginning of
    >> commit, including delete on it (an object may decide it shouldn't be
    >> deleted).
    >Yeah, all this logic can exist as a part of
    >DataContext.commitChanges(). Now, do we want to split "validateForSave"
    >into separate "validateForInsert", "validateForDelete", etc., just like
    >EOF does? I don't think it matters either way. I vote for a single
    >method since object internally can determine its state. Maybe instead
    >of "DataObject.validateForSave" call it "DataObject.validateForCommit"?

    I've been in situations where I had to perform certain validation steps only
    for newly created objects. So I'd vote for separate methods just like EOF
    does, that shouldn't be hard to implement either. The original idea was to use
    DataContext events just for that, maybe that's still a good idea?

    -dirk

    -- 
    COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
    --------------------------------------------------
    1. GMX TopMail - Platz 1 und Testsieger!
    2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
    3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
    



    This archive was generated by hypermail 2.0.0 : Mon Sep 01 2003 - 03:32:21 EDT