开发者

What is the need of a Custom Persistence Framework in Java?

开发者 https://www.devze.com 2022-12-18 21:46 出处:网络
We have a custom Per开发者_开发百科sistence Framework wrapping the Entity Beans. I want to know why is this required or does it have any performance improvement when we already have Entity Beans (CMP)

We have a custom Per开发者_开发百科sistence Framework wrapping the Entity Beans. I want to know why is this required or does it have any performance improvement when we already have Entity Beans (CMP) why the persistence framework is required.


We have a custom Persistence Framework wrapping the Entity Beans. I want to know why is this required or does it have any performance improvement when we already have Entity Beans (CMP) why the persistence framework is required.

You could of course use Entity Beans directly but my guess is that the custom framework is there to hide, if this is even possible, some bits of the complexity of the Entity Beans, hence the name "wrapper". But it is very unlikely that the wrapper does improve the performance as wrapping a Trabant with the body of a Testarossa won't magically make the Trabant perform like a Ferrari.

PS: Hibernate can be used with Java 1.4.


It is not required.

We can't answer for the performance improvements, not knowing it.

You must understand that CMP is a very dated technology (EJB 2). Try to keep away from it as much as possible, modern technologies such as JPA implementations have much better performance and ease of use.


UPDATED after OP comment:

The custom framework was developed back in 2001 and is working as a wrapper. We cannot move to JPA at this moment, the product is still working on java 1.4.2. I want to know why a persistence framework is required. Any help will be appreciated.

Such a custom framework is not required in general.

However, you already have it, and have probably hundreds of uses of it. Changing such a framework is a big effort, with high risks for regressions, so you can't do it just for fun.

If you think that your application is heading toward a regular JPA framework in the medium-range future, I would hold my breath until then. At that time, you can get rid of the old framework, and start fresh. And add framework features ;-), but only as needed!

0

精彩评论

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