Re: Equivalent functionality to EOObserving and EOObserverCenter.addObserver

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Nov 24 2003 - 18:36:33 EST

  • Next message: Gary Jarrel: "Primary Key Always Null"

    Hi Robert,

    Cayenne does not have this functionality by default, but the good news
    is that it should be rather easy to implement. You may be already aware
    that there is a way to customize class generation templates when doing
    class generation with Ant:

    http://objectstyle.org/cayenne/userguide/javagen.html

    You can take Cayenne class generation template (e.g.
    dotemplates/superclass.vm inside cayenne.jar) and modify setter methods
    to fire an event for each property modification. You can use Cayenne
    EventManager to register observers and fire events:

    http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    event/EventManager.html

    Note though that in 1.0 EventManager is overly synchronized, while in
    1.1 it is more streamlined for synchronous notifications and also
    supports asynchronous posting. Let us know if 1.0 version causes any
    problems in your app. I think it should be fairly easy for us to
    backport 1.1 EventManager and release it in 1.0.4.

    I don't know if you need the functionality of EODelayedObserver? If so
    we can discuss its implementation too.

    Andrus

    On Nov 24, 2003, at 12:43 PM, Robert Bose wrote:
    > I was wondering if there was equivalent functionality to the
    > EOObserving =
    > and EOObserverCenter.addObserver() entities/methods in cayenne. I
    > would =
    > like to be able to listen for a change to an object within a data =
    > context so I can update a graphical view. If there isn't, is there a
    > way =
    > to listen for a change.
    >
    > Thanks
    >
    > Robert Bose
    > Senior Java Developer
    > Entero Corporation
    > Robert.Bos..ntero.com



    This archive was generated by hypermail 2.0.0 : Mon Nov 24 2003 - 18:36:37 EST