Dependency Injection with Spring or Java EE 5 / EJB 3.0 ?

Frameworks like Spring have ridden the IOC / dependency injection wave to popularity. However with Java EE 5.0 and EJB 3.0, dependency injection capabilities will be very much part of Java EE.

Debu Panda in his article “Using Dependency Injection in Java EE 5.0” says that “Dependency injection (in Java EE) is the inverse of JNDI. It lets you declare dependencies and lets the Java EE container handle the complexities of service or resource instantiation and initialization when the resource is required.”

In Java EE 5, you can easily use dependency injection for resources, datasources and even web services. A few vendors already have released EJB 3.0 ready servers. So the question is “Is the dependency injection framework wave over and should you now look only at Java EE for your dependency injection needs?”

Related:
>> How to decide which persistence technology to use? JDBC / CMP / EJB / Hibernate?
>> With EJB 3.0, any Java developer is an EJB developer
>> What’s special in EJB 3.0?
>> 5 good things about the Spring framework
>> Checking EJB 3.0 performance
>> Spring In Action: 9I Book Review

The following two tabs change content below.
Content Team

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!
Content Team

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!

  • harshad

    Dependency Injection and Spring have now been in the spotlight for a couple of years.
    So I guess it’s time for Java enthusiasts to switch to the next big thing.
    Anyway, once a technology gets incorporated into the standards, it no longer is cool enough for Java buffs. 🙂

  • Noname

    What a ridiculous comment:
    a) You can choose not to use dependency injection, but its made my life miles easier especially when combined with an intelligent build process
    b) Since when are apache the godsend and any other open source provider rubbish? Spring is just one of loads of great open source software not from apache. In fact WebWork is one of them as its from Open Symphony (not Apache) and it just so happens that the merger will use the majority of WebWork and bin most of Struts because Struts is vastly inferior as a framework (even though its from Apache!!).

  • Noname

    what about the question ‘Do you need dependency injection?’

    like EJB was once forced down our throats, its the same case with depedency injection today

    If you have to use it I would certainly pick the Java EE option. Spring is not even from Apache.

    Struts + WebWork merger whenever it happens could also be a better option than Spring.

  • Noname

    The reason might be the endless and unecessary discussions you see in the Java community. So google would throw more results and that gets Java to top TIOBE 🙂