[
https://jira.jboss.org/browse/CDI-7?page=com.atlassian.jira.plugin.system...
]
Dan Allen commented on CDI-7:
-----------------------------
I believe the intention of the spec is to support less-specific observers. This is pretty
clear from the introduction of chapter 10: Events.
"The event qualifiers act as topic selectors, allowing the consumer to narrow the set
of events it observes."
The examples in 10.2.2 and 10.2.3 clearly support the use of qualifiers as narrowing topic
selectors [1].
I think the problem is that the statement in 10.2 is simply incorrect and needs to be
fixed, as it inadvertently contradicts the intended feature. (I think the authors simply
didn't see the apparent contraction due to reading the sentence with a bias).
The statement should use terminology from set theory to make the statement irrefutable.
I'll propose the following rule that I believe captures the intended behavior:
"The qualifiers of an observer method must be a subset or exact set of the event
qualifiers."
I think it would be a true mistake to allow only an exact set match, as that would
significantly diminish the usefulness of observers. There is value in being able to
capture groupings of events (for instance, all login events or all document events).
[1] 10.2.2 says "the following observer method [with no qualifiers] will always be
notified of the event" and 10.2.3 says "less specific, observers will also be
notified of this event", both supporting the idea that qualifiers on an observer may
be a subset of the event qualifiers.
Section 10.2, bullet 3, first paragraph contradicts the rest of the
section
---------------------------------------------------------------------------
Key: CDI-7
URL:
https://jira.jboss.org/browse/CDI-7
Project: CDI Specification Issues
Issue Type: Task
Components: Specification
Affects Versions: 1.0
Reporter: Pete Muir
Priority: Blocker
Fix For: 1.1
"The observer method has all the event qualifiers."
This contradicts the examples (section 10.2.3) and the use of @Any, all of which indicate
that less specific observer methods are also invoked.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira