문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top