I think I like the approach of having the UnitOfWorkConcern applied to my 
service's methods.

Would it be sensible to also allow a class (~Composite) as target for the annotation so that all public methods of the Composite get the Concern applied?

Hmm was looking to subclass the Concern to add another AppliesTo that includes a custom filter or my service composite, but the concern is final.

How would I otherwise have a existing (final) concern be applied to a range (or all) of the methods of a certain composite without adding the original AppliesTo target annotation (@UOWPropagation in this case) to each of these methods.

Michael

Am 24.09.09 03:54, schrieb Rickard Öberg:
Michael Hunger wrote:
so that it injects the current uow into an existing:

@Invocation UnitOfWork uow;

within the composite.

WDYT ?

The concerns are reused, so it's not really possible to do.

Michael, who was looking for a problem with that but just forgot to
add @Concerns( UnitOfWorkConcern.class ) to the composite. I thought
we had some mechanism for Concern detection for annotations but was
obviously wrong :)

Ok, so we have thought about this before. The main problem with it is
that it becomes difficult to declare order of Concerns.

That being said, in many cases where ordering is important the Concerns
will be triggered by annotations, so it *would* be possible to use the
annotation ordering to sort it out. It's a bit magic though.

I.e.
@Secure @Logged
public void foo();

would be different from
@Logged @Secure
public void foo();

if the concerns are applied from the annotations, in the order they appear.

It sure would be handy though, just as constraints implementations can
be declared on the annotation.

/Rickard


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to