In this particular case we might need to leave unit testing world (mocks, spies and other test doubles) and develop real integration tests. The SeamTest module together with JBoss Embedded could help but it's really a tough task to make it running with Maven. On the other hand JBoss AS wasn't the target environment for us. Thankfully there is a new kid on the block from JBoss called Arquillian.
Contexts and Dependency Injection
Submitted by david on Thu, 07/22/2010 - 06:36
Whether you call it Contexts and Dependency Injection, CDI, JSR-299, Web Beans, Spring Lite or what - if you play in the Java world, you better call it something. I won't get into the long history or permutations of this JSR, but it has had quite a bit of input from industry leaders.
If you are new to the concepts of Dependency Injection and Inversion of Control, I will try and get some resources up here soon. But if you are familiar with the Spring Framework, likely the concepts of Dependency Injection isn't new to you. In fact, CDI owes a great debt to a few technologies that you are probably already familiar with: But with CDI on the scene, and the reference implementation by JBoss, Weld available now, users of other IoC containers may be asking themselves, "Should I use CDI, or should I use Spring 3?"
A blog entry is on the works for translucent development on the changes in Spring 3 and will be available soon. But what do you think? Will CDI be good for the platform? Will it help to consolidate technologies in the same way that JPA did for ORM technologies in Java?
We are still working on getting the development links section of translucent development organized. Please bear with us as we bring these new resources online.
Whether you call it Contexts and Dependency Injection, CDI, JSR-299, Web Beans, Spring Lite or what - if you play in the Java world, you better call it something. I won't get into the long history or permutations of this JSR, but it has had quite a bit of input from industry leaders.
If you are new to the concepts of Dependency Injection and Inversion of Control, I will try and get some resources up here soon. But if you are familiar with the Spring Framework, likely the concepts of Dependency Injection isn't new to you. In fact, CDI owes a great debt to a few technologies that you are probably already familiar with: But with CDI on the scene, and the reference implementation by JBoss, Weld available now, users of other IoC containers may be asking themselves, "Should I use CDI, or should I use Spring 3?"
A blog entry is on the works for translucent development on the changes in Spring 3 and will be available soon. But what do you think? Will CDI be good for the platform? Will it help to consolidate technologies in the same way that JPA did for ORM technologies in Java?
We are still working on getting the development links section of translucent development organized. Please bear with us as we bring these new resources online.
-
arquilliancditesting
-
Dan Allen's presentation on how JSR-299 will impact SeamcdijavaSeam
-
I may be a Spring fanboy but I’m also convinced a technology should embrace standards. Although Spring is now a de facto standard, it is in competition with other products, like Google Guice for example. It makes my work as an architect harder since my craft is to devise the most perennial solutions: standards are my allies in achieving this goal. CDI, formerly known as JSR 299, is an attempt at describing a true standard on Dependency Injection. What makes CDI appealing at first glance is that both SpringSource and Google took a seat in the specifications team.cdijava
-
Digging in further to CDI, this entry talks about Producers, Interceptors, Decorators, Observers, and Alternatives. It also touches on AOP and testing a bit.cdijava
-
But it turns out--somewhat unintuitively--that if you inherit from a class that has an injection point in it--even if the injection point is defined in terms of Java EE and not CDI--and if that abstract class comes from a jar that is not a bean archive, then dependency injection by the CDI provider will not be applied to its injection point until you make sure that its jar file contains a META-INF/beans.xml file. A simpler way to put this is that for any given inheritance chain, all jars in the chain containing classes with injection points must be bean archives.cdijava
-
Going to go over the steps to get a simple HelloWorld web-app up and running on JBoss 6 using JSF 2 and CDI. Background information and full documentation for the technologies used can be found at the Java EE 6 home page and Weld documentation site.cdijavamaven
-
The Current State Due to Spring’s early success and adoption, Java EE 5 and Java EE 6 were pushed to greatly simplify the Java EE programming model, increase developer productivity and become much simpler to use than previous versions. The current Java EE 6 solutions are thus just now achieving the ability to compete against Spring's programming model. Developers now are ready to ask the question "Why you would prefer Spring?" Here is my take:cdijavaJPAspringweld
-
I do have some issues with Cameron's statements that frameworks are mistakes of the J2EE past and that Java EE 6 represents the future. Open source frameworks made J2EE successful. Struts and Hibernate came out in the early days of J2EE and still exist today. Spring came out shortly after and has turned into the do-everything J2EE implementation it was trying to fix. Java EE 6 might be a better foundation to build upon, but it's certainly not going to replace frameworks.cdijavaJPAJSFweld
