• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 3.0 : why Java Persistence API ?

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why Java Persistence API ? There are so many persistence frameworks, it sounds like reinventing the wheel. Any particular reason for creating another new api ?

Also, as JPA is part of JSR-220, does it mean that I can't use it without EJBs ? I mean, is it possible to use it with J2SE ?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why? in part marketing, in part to have a standard.
can you use it without JEE? no, of course not. It's part of JEE, so you cannot use it without having JEE running. You may be able to use it outside an EJB context though.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other than making a standard, are there any other motivations to make another api ?
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satou,

Standards aren't necessarily intended to develop new technologies, even though in some cases they do. Just like any standards in any business they unify the industry over a common substrate. This is useful for everyone in many ways, including but not limited to certification, safety, communication and training, interoperability, and so on. Just because lots of products have been using a technology does not mean that it does not need to be standardized. In fact, more products using the same technology actually strengthens the argument to standardize it, and is precisely the reason why ORM is only being standardized now instead of 10 years ago when TopLink was the only real mapping software on the block.

The answer to your question is a definite yes. JPA can be used both within an EJB Container in Java EE, in a Tomcat web container, or completely outside of either in a regular Java SE VM. That is the flexibility that we designed into the JPA spec to allow for greater testability, as well as the occasional application that is not server-based.

-Mike
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
thank you for answering.

That's interesting.
With EJB3.0/JPA, we've got a contender for Test Driven Development here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!