문제

I have a small yet complete Java EE 6 application at hand.

The traditional annotations are being used: @Resource, @EJB, @Singleton, @PostConstruct, @PreDestroy, @PersistenceContext, @ManagedBean, @ManagedProperty, @RequestScope, @ApplicationScope,...

I would like to evaluate whether it makes sense to introduce CDI, and to standardize on a common strategy for dependency injection, bean lifecycle management, etc.

Question: Does anybody know about good articles, examples or manuals that transform traditional Java EE 6 annotations into CDI ones?

도움이 되었습니까?

해결책

Does anybody know about good articles, examples or manuals that transform traditional Java EE 6 annotations into CDI ones?

Not stricly about a "transformation" but very good resources IMO:

Related question

다른 팁

In my opinion, "switching" to CDI is no big deal. Just add a CDI implementation (like Weld) to your libraries, and start adding CDI Beans/Annotations to your app. You don't have to change your existing codebase. I would suggest reading the Weld reference.

If you plan to use JBoss CDI Implementation (Weld) you might be interested in this CDI with JBoss Weld article.

Following the line suggested I recommend reading :

The Java EE 6 Tutorial - Contexts and Dependency Injection

In the same spirit, I like the following article:

Spring to Java EE – A Migration Experience

It's not about "Old-skool Java EE"-to-"CDI-based Java EE", but more about Spring-to-Java EE 6.

Off-topic, but an interesting read anyway.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top