Re: Implementing Entity "restricting qualifier" in application?

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Sep 24 2003 - 12:26:24 EDT

  • Next message: Mike Kienenberger: "addToManyTarget() changes PersistenceState.COMMITTED to PersistenceState.MODIFIED"

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > For now as an easy fix I suggest another API change. Add a method like
    > "willPerformQuery" to an OperationObserver interface, and then allow
    > setting custom OperationObserver on DataContext. This will expand the
    > delegation capabilities of Cayenne in general, and would allow to
    > customize code for your particular case. Internally we can chain custom
    > observer with default ones provided by Cayenne so that even a noop
    > custom class wouldn't break DataContext behavior.

    Are you suggesting that I modify OperationObserver or that I create another
    interface like OperationObserver? Along those lines, are you suggesting
    that the custom OperationObserver replace all internal OperationObservers or
    that it mirror/duplicate whatever methods are called for the current
    OperationObserver classes?

    My interpretation is that I should modify OperationalObserver, and somehow
    use the Custom OperationalObserver in addition to what's already there.

    And what should the signature for "willPerformQuery" be?

    public void willPerformQuery(Query) -- Not sure how this allows me to modify
    it. Matches signatures of existing methods.

    public boolean willPerformQuery(Query) -- Would allow you to veto an
    operation, but not modify it. Matches name of method.

    public Query willPerformQuery(Query) -- Would allow returning a new query or
    null to veto it. Provides useful functionality :)



    This archive was generated by hypermail 2.0.0 : Wed Sep 24 2003 - 12:26:13 EDT