aspose file tools
The moose likes Object Relational Mapping and the fly likes Hibernate and objects propagation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate and objects propagation" Watch "Hibernate and objects propagation" New topic
Author

Hibernate and objects propagation

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
Is it condsidered an OK design to propagate the entity objects to the views in a JEE application?

For example: Is it ok to set a persistent object in the Http request so its peoperties is displayed to the user?
If not, what are the alternatives?

Note: In a larg application it will be very time consuming to create another bean for every persistent object.


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Exactly.

The big thing to Java EE 5 and EJB3 is that now you can send the domain objects to the client. Before EJB 3 Entity Beans were not Serializable, so we create the dreaded DTO Antipattern. Now we have our "Entity Beans" as POJOs so they can be Serializable and sent to the client. That is the best practice. And if you have a version field, you can re-attach these detached objects with optimistic locking.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Hibernate and objects propagation
 
Threads others viewed
Need to understand session.merge()
What is object serialization?
AbstractWizardFormController: teasing command object
caching data
IdClass & lazy initialization
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture