I don't particularly like the idea of @Veto being an @Alternative stereotype, I think
it should veto the bean. Also there is not really that much difference between typing
@Veto and @Alternative anyway, and @Alternative is clearer as it is part of the spec.
Also implementing @Veto as a stereotype would prevent the bean being specialized in
seam-xml, as seam-xml would apply the @Veto stereotype to the configured bean.
Stuart
________________________________________
From: Dan Allen [dan.j.allen(a)gmail.com]
Sent: Sunday, 11 April 2010 3:51 PM
To: Stuart Douglas
Cc: seam-dev(a)lists.jboss.org
Subject: Re: [seam-dev] Xml module and preventing bean installation
On Fri, Apr 9, 2010 at 7:44 PM, Stuart Douglas
<stuart@baileyroberts.com.au<mailto:stuart@baileyroberts.com.au>> wrote:
After some discussion with Tihomir I have added an @XmlConfigured annotation to seam-xml.
This prevents the bean from being installed, so it is possible to create beans with
ambiguous dependencies and allow the user to pick which one they want with XML
configuration.
The problem with this is that if you want to use it you now need a compile time dependency
on seam-xml just to get one annotation. Should we have a @DoNotInstall (or whatever)
annotation in weld-extensions instead, or is a compile time dependency on seam-xml ok?
Tihomir has pointed out that @XmlConfigured makes it much clearer what is going on, and
tells anyone reading the code to look in beans.xml, and I am inclined to agree with him,
but I would like to know what everyone else thinks.
Building on this, I was thinking that we should provide a @Veto annotation in a common
module (perhaps Weld extensions), that can be used to prevent a class from being
installed. The @Veto annotation would be an @Alternative stereotype. Naturally, this is
pretty easy for users to create, but since the need is so common, I would think it makes
sense to provide it. WDYT?
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen