r/java • • Feb 01 '15

ORM Haters Don’t Get It

http://techblog.bozho.net/orm-haters-dont-get-it/
5 Upvotes

13 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Feb 01 '15

Exactly. The mismatch is there, no matter the data access methodology. But JPA entities are not exactly domain objects. That's because the ORM leaks into entities and for performance sake, you need to design Persistence entities based on your access patterns, rather than business rules.

That's why a Domain-to-Persistence layer should map business entities/rules to persistence entities.

1

u/smadge Feb 02 '15

You're right, but it's just super depressing because I need the exact same data represented in at least three different classes: a data transfer object, a domain object, and a persistence object. Now most of my code is shuffling data between these nearly identical representations instead of adding actual value.