This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb 3.0 vs spring  RSS feed

 
hani Ibrahim
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all,
i have question about ejb3 .i know that Dependency Injection which is in spring xml file.in ejb3 annotation.so we return in ejb to hardcoded.not one place like spring right?so where is dependency injection?
thanks all.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by hani Ibrahim:
so where is dependency injection?

Wherever you have an annotation. For example, if you write @DataSource, the container injects the proper datasource.
 
hani Ibrahim
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that the dependency injection via annotation But this is inside the code !!!.so if i have to change the jndi nameinside annotation in every class!!
it is the smae like i wrote 2 lins of code for JNDI.but in spring you write it in xml file.it is outside the code.
please clarify to me that!!
 
saurav sarkar
Ranch Hand
Posts: 180
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not worked on EJB 3.0.
But as far as i know......In Spring
we use the XMl file.So in that terms
Spring is more flexible thant EJB 3.0
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from a few exceptional cases, 99.9% of Java EE 5 annotations can be expressed in XML, in the configuration files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!