• 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

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike/Merrick,
Do you think that EJB3.0 will be shadowed by frameworks like Spring ?
I think you've said in another thread that one advantage is that EJBs have a spec. On the other hand, one of Spring's authors' arguments is that it is better to have no spec, rather than a bad spec
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Spring and EJB are not mutually exclusive. Spring can be an excellent framework to provide access to EJBs in fact without all that hassle of requesting remote interfaces, casting them, and all that stuff.
2) The EJB spec isn't necessarilly bad, it's just that EJB have been (and are being) used for a lot of things they should not have been used for.

We're using Spring to provide access to EJBs and it works like a charm.
Getting an EJB reference/stub has been reduced to


BeanFactoryLocator locator = SingletonBeanFactoryLocator.getInstance();
BeanFactory beanFactory = locator.useBeanFactory(BEAN_FACTORY_ID).getFactory();
AuthenticatorService remote = (AuthenticatorService) beanFactory.getBean(BEAN_NAME, ServiceInterface.class);
return remote;



where ServiceInterface is the interface for the EJB service you map in your Spring config.
[ August 15, 2006: Message edited by: Jeroen T Wenting ]
 
author
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Satou,

Rod Johnson himself contributed the forward to our book, and I think it's safe to say that they see JPA as a big step forward in enterprise Java persistence. The next release of Spring is expected to include direct support for the Java Persistence API.

The area where Spring and EJB 3 tend to collide is in terms of the component model. Both solutions offer a simple, POJO-based component model and dependency injection. In many respects the EJB 3 model is a subset of the Spring component model, but on the other hand your application may not require the added features offered by Spring.

In any case, I view the two as being compatible, and we even included an example of using Spring to test EJB 3 session beans in the book. I think that EJB 3 offers a compelling solution, and don't expect it to be overshadowed by Spring.

Cheers,

Merrick
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks both of you for your comments.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic