Re: Changes to Events API
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Libor, no, it isn't possible. Cyclic composite relations are forbidden in MOF (you get CompositionCycleException if you try to create cyclic composition) - i.e. if something is a component of A, it cannot be container of it (neither directly nor transitively). Martin Libor Kramolis wrote: > Hi Martin, > > thanks for proposal. I will use it in XML case. I have just one > question, do you consider a *cycles*? It is not problem of XML model, > but in general it is possible, isn't it? > > Thanks, > Libor > > > Martin Matula wrote: > >> Hi, >> from the discussions that I saw at some external mailing lists and >> from the discussions I had with the people here at Sun that intend to >> use the MDR it showed up that what would be a good thing to have is a >> possibility to listen to events on objects' containers (composites). >> This means that the events should be propagated not only up to the >> proxies, but also to objects' composites. This way someone who wants >> to listen to any changes in a Java class would listen to the class >> only (and would not be forced to register listeners to all the >> methods, their parameters, attributes, etc.) The same is applicable in >> many other cases (UML metamodel, XML, etc.) >> Thus I propose that events on RefObjects are propagated also to their >> composites. Once the event gets to the composite, it will be >> propagated to its composite, but not to its proxies (thus the current >> event path via proxies would be followed only for events originating >> from the given RefObject). I.e.: >> >> APackage extent contains AClass and BClass class proxies, A is >> instance for AClass, B is instance for BClass. >> A is a component of B, A is changed -> event goes to A, from A to >> AClass and B, at B it is forgoten, from AClass it goes to APackage, >> from APackage it goes to repository. >> >> Now the question is, how the listeners should register for the events >> from containers. I would like to add method addListener(..., boolean >> includeComponents), however this would be applicable only for >> registering listeners on RefObjects. Should there be a special >> RefObjectEventSource for RefObjects? Any suggestions are welcome. >> Martin >> >