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
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.