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

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!

0 thoughts on “Dependency Injection with Spring or Java EE 5 / EJB 3.0 ?

  • January 15, 2006 at 11:30 pm
    Permalink

    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. 🙂

  • January 9, 2006 at 7:18 am
    Permalink

    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!!).

  • January 9, 2006 at 1:30 am
    Permalink

    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.

  • January 2, 2006 at 10:55 am
    Permalink

    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 🙂

Leave a Reply