开发者

What's the "low risk" choice between JDO or JPA?

开发者 https://www.devze.com 2023-01-19 05:46 出处:网络
Do not close this as a duplicate of other questions because I\'m not asking the same thing. They\'re also about a year old. That said, see these links:

Do not close this as a duplicate of other questions because I'm not asking the same thing. They're also about a year old. That said, see these links:

http://db.apache.org/jdo/jdo_v_jpa.html

http://www.datanucleus.org/products/accessplatform/jdo_jpa_faq.html

http://www.datanucleus.org/products/accessplatform/persistence_api.html

It seems JPA is the "popular" choice backed by the big vendors (who love to screw you over if they can). It seems JDO is the more matu开发者_JAVA百科re, seemingly superior choice which should enjoy more OSS community backing. (But does it?)

So what's a low-risk tolerance organization supposed to do? Is the difficulty of going from one to the other about the same? Has one started to emerge above the other at this point? Also, only because we currently use it, does Hibernate limit you to JPA-only? If so what is the most popular JDO implementation?


@Crusader - what makes you think that anyone on SO has a better crystal ball than you do?

So what's a low-risk tolerance organization supposed to do?

Pick the alternative that it determines to be the low risk solution. How it determines what solution has the least risk is ... unclear ... but I don't think that asking SO is a valid risk assessment procedure.

The other point is that choosing JDO when JPA is the "winner" (or vice versa) probably won't kill your project in the short or long term. The consequences of making the wrong choice are most likely limited to greater staff training costs, and being stuck with base ORM platform where development has stagnated and support is increasingly expensive. [I'd protect myself against the latter by picking an open source ORM platform ... either way.]

Is the difficulty of going from one to the other about the same?

Probably yes. Especially when you consider data migration issues.

Has one started to emerge above the other at this point?

JPA seems to dominate these days. The JDO folks would say that their way is technically superior, but that's not the point.

Also, only because we currently use it, does Hibernate limit you to JPA-only?

JPA plus Hibernate-specific extensions. Certainly Hibernate does nor support JDO and it probably never could.

If so what is the most popular JDO implementation?

Pass.


If you use a lightweight dependency injection and ORM wrapping framework like the open source exPOJO it allows you to bypass that question altogether. Your main code base remains completely agnostic of the underlying persistence interface/technology (JDO, Hibernate implementations currently supported, JPA on the way - like to lend a hand?).

All persistence technology specific code is encapsulated within Repository and Service classes as per Chris Richardson's excellent book "POJOs in Action" and exposed using the "exposed domain model" pattern he discusses in the book - which turns out to be pretty awesome and the most productive approach I've ever used.

Using exPOJO 99% of your code remains gloriously and instantly portable between JDO, JPA, Hibernate plus you get extremely lightweight and very simple dependency injection (no annotations or XML required) as an added bonus.

It comes with it's own extremely lightweight and easy to use servlet filter that can provide "open session/persistence manager/entity manager in view" without the XML hell. Each HTTP request is automatically attached to a ModelExposer object that provides convenient access to the repository and service components that allow generic access to your objects.

exPOJO is at http://www.expojo.com - yeah ok, I wrote it so I am biased slightly =]

0

精彩评论

暂无评论...
验证码 换一张
取 消