This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: javax.dependency.Inject
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
After hearing more about EJB 3, and talking to various people, why are we putting dependency Injection semantics in an EJB spec?
I can see one reason: "Let's just get EJB 3 done"
This is a reason for not splitting the persistence API into a truly seperate JSR (although it IS mean to be a seperate spec/tck/runtime).
Dependency injection is a very generic concern, and one that should be shared throughout a bunch of specs. One tiny JSR could flush out the semantics
of dependency injection, and end up with javax.dependency.*.
Then EJB 3 would specify that "When you @Inject a transaction manager.... you must do X". A future Servlet spec could do the same thing for their resources, etc etc.
Also, lightweight containers would have the option of groking these annotations too, without needing some ejb.jar.
Wouldn't that be nice?