JEE 6 easier than Spring

0:16 JPCO 0 Comments


Java EE 6 was released 3 years ago. 
JEE 6 come with "Contexts and Dependecy Injection for the Java EE Platform" JSR-299. 
This specification was developed and lead by the Spring creatior, Rod Johnson.

JEE6 makes the EJB development easier.
Interfaces are no longer required for the implementation of business components.


 @Stateless  
 public class EJBEasier{  
  public void simple(){  
   System.out.println("Hello");  
 }  
 }  

It isn't necessary declare the EJBEasier class in deployment descriptor, any bean java class can be a EJB, only with the @Stateless annotation and without any interfaces.


The Hello POJO can be injected in stateless session bean 


 public class Hello{  
  public void say(){  
   System.out.println("Hello");  
 }  
 }  

@Inject annotation inject the Hello POJO in the EJB.
  @Stateless   
  public class EJBEasier{   
  @Inject  
   Hello hello;  
  public void simple(){   
    hello.say();  
  }   
  }   

There is no xml configuration !  easier couldn't be it. 

Currently you can choose between 14 compliant application server with JEE 6, with a variety of open source and commercial.








0 comentarios: