O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CDI and crosscutting concerns

CDI helps us with writing type safe and portable crosscutting concerns, where a technical component spans across different areas of application. If these concerns were implemented as a traditional code they would be scattered across the entire application through duplicated code, moreover entangled with the core business logic.

Interceptors

CDI supports two ways of extending the functionality of the bean managed by the container, namely: Interceptors and Decorators.

Interceptors are the way to add crosscutting concerns to several managed beans. A classic example of a crosscutting concern is logging, because it is a feature that is a part of multiple domains. Practically any software system may require the logging ability. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required