• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ejb 3.0 vs spring

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41911
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 180
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic