Question

I'm implementing data access logic in a Java application using Hibernate and I'm a little confused about this issue. AFAIK one of the main advantages to use ORM systems is to work with attached object, but using DAO approach leads to have (in many application contexts) detached entities.

I read several posts about this issue (this for example), but I can't understand if there is a correct apporach to follow, or if the choice is left to developer. Can you help me?

Was it helpful?

Solution

Why do you think that not using DAOs is going to alleviate your detached objects scenarios? I don't think it will. If you want to use ORM, you simply need to re-attach objects sometimes.

In the answer to a related question, I argue that you really should use DAOs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top