31

Spring has been a good framework for DI and AOP for Java developers.

Now, there comes a standard specification for DI and AOP which is CDI.

Any good product can no longer stays good without supporting the relevant standards. (For example, Hibernate supports JPA specification)

My question is, will Spring support the standard specification (CDI) in its future releases?

siva636
  • 16,109
  • 23
  • 97
  • 135
  • 2
    is this relevant? http://cdisource.org/site/2011/06/spring-and-java-ee-6-cdi-get-it-done/ - Might be helpful – TeaCupApp Aug 30 '11 at 04:09
  • @kiro Really a useful link and this article deals with Spring / CDI integration but dosen't discuss Spring (future) support for CDI. I like to discuss whether Spring will support CDI, if not what are the possible (technical and other) reasons. – siva636 Aug 30 '11 at 05:16
  • 1
    Spring already supports CDI's `javax.inject` annotations, but I'm not sure about the AOP stuff. Also, CDI goes a long way beyond DI (e.g. facelets integration). COuld you be more specific? – skaffman Aug 30 '11 at 08:23
  • @skaffman Just ignore the stuff which goes beyond DI & AOP (both in Spring & CDI) when discussing this topic. – siva636 Aug 30 '11 at 09:46

1 Answers1

15

Even though Spring is open source and used and supported by a large community, its future development is controlled by a single company (spring source / vmware). As such, its decisions are inherently non-public and certainly influenced by a large number of factors - like the currents demands of the community, but certainly also financial and political aspects (at the end of the day it's all about money).

So it's important to conclude that spring / spring source is not bound to any official process (such as the JCP would be) and one cannot foresee what spring source will decide in the future. On the other hand, past actions lead to the assumption that spring source is not - cough - specially interested in implementing the full CDI stack (JSR 299). Remember that even though spring source initially joined the JCP for JSR 299 (together with sun, redhat, google, ...), they all had a terrible fight about it which resulted in the fork of JSR 330, which is nothing but a subset of JSR 299. Plus: Implementing the (stateful) CDI model of dependency injection in any future version of spring would be a real bunch of work.

So, to make a long answer short: Even though we don't know about the future, it's pretty safe to assume that spring / spring source will never support JSR 299 as a whole, but stick with their implementation of JSR 330.

Jan Groth
  • 14,039
  • 5
  • 40
  • 55
  • 4
    Yes, splitting the injection model into two really seems to be a politicized issue as Jan Groth suggests above. I can even see in the Final Approval Ballot (http://jcp.org/en/jsr/results?id=5017), IBM voted against this move and calls for a united model. – siva636 Sep 05 '11 at 05:02
  • The reason to split was probably due to compatibility reasons. Spring DI model is kind of legacy and even now in 2017 they do not support al the capabilities of CDI. –  May 25 '17 at 10:01