I have a rather complicated application using POJO and now it came to port it to EJB3.1 so that it can be deployed online, accessed through REST services and benefit from the container environment (persistence was the most important, but transactions would have been useful).
I have been out of Java EE since J2EE, and I am struggling to unravel the "loss" of the beans object. It took me a while to understand that Entities in EJB3.1 are not really Beans in the old sense ... :) I read several EJB3 books, including the O'Reilly Enterprise JavaBeans 3.1 User Guide, all of which explain concepts and EJB3 components, but not implementation template parameters.
In my research and research looking for Java EE 6 patterns, I rather took the approach of Adam Bien, especially the "Persistent Domain Objects" (PDO) pattern (in his book, but also briefly here: http://download.java.net/ general / podcasts / real_world_java_ee_patterns.pdf ), which seems to provide the least complexity and greatest synergy with my current POJO application. PDO is also closely associated with traditional object-oriented philosophies and approaches and really appeals to me.
Instead of answering the PDO debate, I'm interested in hearing from the people who implemented it and what worked against where you had difficulties. In particular, I would like to know how you made calls from JPA objects to other services in the container (for example, calls to a session without Beans state, etc.).
I would also be interested to know if there are alternatives to the PDO template that allow me to maintain the structure of the application (using polymorphism, etc.) without the need to create a bean session and JPA entity for each class in my model, (I do not want to do this partially due to the huge exercises needed to reorganize all unit tests and integration, and partly because, as far as I can tell, I will try to reproduce my relationship with 1toMany objects, etc. in my Beans session too, which seems crazy) .
Does anyone have any impressions to share, or if you want to point out that I'm an idiot and have missed something fundamental in Java EE 6, which will also be "welcome" :)
TIA
user1180316
source share