Re: EventSubject implementation

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 27 2003 - 19:51:31 EDT

  • Next message: Holger Hoffstätte: "Re: EventSubject implementation"

    On Friday, June 27, 2003, at 06:29 PM, Holger Hoffstätte wrote:

    > You are right. Making the simple string more meaningful was the main
    > reason for the 'owner' of the subject, which we made a class for the
    > first
    > cut. The combination of owner and subject name is meant to be unique so
    > that two equally named subjects do not collide on the same bus; using a
    > class as namespace-enabled 'tag' was the first thing that came to my
    > mind,
    > although I could immediately come up with scenarios where that would
    > break
    > down as well. Maybe a unique name should be made of the class package
    > and
    > subject name like e.g. "my.nifty.class/FooSubject", exposed via (say)
    > getSubjectIdentifier() and simply using getOwner()/getSubjectName() at
    > first..
    > This is basically an insolvable problem without central registry.
    > So just adding the getters won't do much harm for now, I guess.

    Well, aside from my original question, current implementation of
    EventSubject will *always* require a reference to the subject instance
    (e.g. as public static final EventSubject XYZ), since EventSubject
    doesn't implement hashCode() and/or equals() method. So essentially,
    creating a subject for the same owner and name twice, will produce two
    different subjects (at least from the point of view of EventManager). I
    don't think this was intended like that?

    So maybe just switch back to Strings?

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Jun 27 2003 - 19:51:29 EDT