Concern

A concern is a stateless Fragment, shared between invocations, that acts as an interceptor of the call to the Mixin. The Concern is a Java class, that either implements the MixinType it can be used on, or java.lang.reflect.InvocationHandler which allows it to be used on any arbitrary MixinType.

Concerns have many purposes, but they are not intended to produce side effects (see SideEffect). Use-cases involves;

  • Transaction handling.
  • Call Tracing.
  • User security.

Concerns are established by the use of the @Concerns annotation on Composites.

Example

@Concerns( { TransactionConcern, UserLoginConcern } )
public class PersonComposite extends Person, Composite
{
}


Qi4j and the Qi4j logo are trademarks of Richard Öberg, Niclas Hedhman and the members of the Qi4j Core Team. See Qi4j licensing for more information.
Powered by SiteVisionexternal link.