On Tue, 06 Jul 2010 20:58:12 -0300, Howard Lewis Ship <[email protected]> wrote:

Actually, that's part of what I'm doing. You should use @Marker on the
service (i.e., on its service implementation class), but use the
annotations themselves on the contribute methods:

@Marker(Red.class)
publlic class SomeServiceImpl extends SomeService { ...

@Contribute(SomeService.class)
@Red @Blue
public void providePurple() {
// Contribute to services which have Color OR Blue
Where we are differing is on that last line: should providePurple() be
invoked for SomeServiceImpl (because it has the Red marker) or NOT
(because its missing the Blue marker)?

No. This has the advantage of using the same rules for the dependency injection JSRs.

Here's the trick: how do you know if an annotation is a marker
annotation or not (as opposed to any other kind of annotation,
including @Match or non-Tapestry specific ones)?

JSR 330 uses an annotation (@Qualifier) in the annotation itself: http://atinject.googlecode.com/svn/trunk/javadoc/javax/inject/Qualifier.html

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to