Mario Ivankovits wrote:
Werner Punz wrote:

To me, it makes sense to use Transfer Objects,

* How do you deal with versioning?

To enable versioning, you have to set a version field in your table,
I tried that approach with my last JSF project, it works like a charm...

I know this, and I use it myself already.

The question is what if one use "Transfer Objects" they are detached from the hibernate object itself, arent they?

So the workflow with transfer objects is:

* DAO->hibernate->Transfer Object
* request,response
* reload hibernate object from database and apply the transfer object values on it

If you use this scheme, your are not able to rely on hibernates versioning as you always load the current version of the object from the database and override its values.


not if you transfer the versioning data as well...




The point is (if I understand the Transfer Object stuff correctly) that transfer objects arent a good solution.

In my opinion no, because once things get more complicated (some relational stuff etc...) you run into myriads of problems which you have to handcode, which you probably could avoid if you just use the pojos from the db....

Doing a transfer object means, either flat out the data, or also transfer the relational data into other transfer objects...
you end up basically with twice the work, and not really a timesaving to
plain jdbc... access or a rather simple direct table to object mapper.

Reply via email to