[cdi-dev] [VOTE] Using @Priority to order events instead of adding a parameter in @Observes

Thorben Janssen thjanssen123 at gmail.com
Tue Oct 28 05:27:57 EDT 2014


+1 (for @Priority)

--
*Thorben Janssen*

@thjanssen123 <https://twitter.com/thjanssen123>
www.thoughts-on-java.org

2014-10-28 10:00 GMT+01:00 Antonio Goncalves <antonio.goncalves at gmail.com>:

> +1 (for @Priority)
>
> On Tue, Oct 28, 2014 at 9:56 AM, Antoine Sabot-Durand <
> antoine at sabot-durand.net> wrote:
>
>> To add events ordering feature we have two choices:
>>
>> 1) Use @Priority from common annotation specification (JSR-250)  (vote +1)
>> pros:
>> - more consistent with other ordering mechanism we already have in CDI
>> (Interceptors, decorators, Alternatives)
>> - more Java EE consistent
>>
>> cons:
>> - time consumed in JSR 250 MR participation (@Priority must be update to
>> support parameter for target)
>> - as @Priority is not part of Java SE, CDI light on java SE will have to
>> add the jsr250 jar as dependency only to have this annotation (which will
>> make it a little less light)
>>
>> 2) Add a parameter to @Observes annotation to give order to an observer
>> (vote -1)
>> pros:
>> - works out of the box (we can add this property without ask for other
>> specs modification)
>> - avoid two annotations to declare an ordered observer (simpler usage)
>>
>> cons:
>> - less Java EE spirit
>> - could be seen as an inconsistency with the way we order Interceptors,
>> Decorators and Alternatives.
>>
>> ————————————————————
>>
>> Who can vote?  Everybody registered to this ML can vote. All votes will
>> be binding
>> How to vote? Answer this mail and vote +1 (for @Priority) 0 or -1(for
>> parameter in @Observes)
>> Vote will be closed in 72 hours
>>
>>
>> _______________________________________________
>> cdi-dev mailing list
>> cdi-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>
>> Note that for all code provided on this list, the provider licenses the
>> code under the Apache License, Version 2 (
>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
>> provided on this list, the provider waives all patent and other
>> intellectual property rights inherent in such information.
>
>
>
>
> --
> Antonio Goncalves
> Software architect, Java Champion and Pluralsight author
>
> Web site <http://www.antoniogoncalves.org> | Twitter
> <http://twitter.com/agoncal> | LinkedIn
> <http://www.linkedin.com/in/agoncal> | Pluralsight
> <http://pluralsight.com/training/Authors/Details/antonio-goncalves> | Paris
> JUG <http://www.parisjug.org> | Devoxx France <http://www.devoxx.fr>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20141028/36baea09/attachment.html 


More information about the cdi-dev mailing list