[cdi-dev] Veto and Requires

Rick Hightower richardhightower at gmail.com
Tue Oct 18 01:59:04 EDT 2011


"Any class or package may be prevented from providing bean definitions based
on the availability of other classes by adding the @Requires annotation on
the class or package."

@Requires({Customer.class, Supplier.class}) public class Order { ...

}


Spring has something similar called @Required with some different behavior.
But now that I think on it... it is different enough....

I'd prefer explicit names for these annotations. @ExcludeFromCDI and @
ExcludeFromCDIIfMissing.

I know those  are  horrible names too. Not a big fan of @Veto and @Requires.


How about @ExcludeAsSource, and it has an optional attribute called requires
that takes an array of class types?

I really really hate @Veto and @Requires. I guess I should search the mail
list and see if I missed this conversation.

-- 
*Rick Hightower*
(415) 968-9037
Profile <http://www.google.com/profiles/RichardHightower>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20111017/9f5726d9/attachment.html 


More information about the cdi-dev mailing list