Efficiently storing entities (eg. orderline in Order) without ORM

129 views
Skip to first unread message

Maciej Hadam

unread,
Feb 1, 2012, 2:21:35 PM2/1/12
to ddd-cqrs-sample
Hi,

What are the ways to efficiently store enitities without
ORM(Hibernate, JPA).
As is it written in WIKI, repository could be used with different
store than relational database. In that scenario we loose the "dirty
checking" Hibernate feature, and the entities have to be redundantly
overwritten

And second scenario.
What if we want to use iBatis or JDBC with relational database.

Maybe the Unit of Work pattern is the solution?
What are yours opinions?

Thanks for response.

Sławomir Sobótka

unread,
Feb 2, 2012, 6:14:52 AM2/2/12
to ddd-cqr...@googlegroups.com
I'm wondering about ratio of unnecessary updates...

If in app layer we usually:

1. Aggregate = repo.load()
2. Aggreate.doSth()
3. repo.save(Aggreagate)

Than we can assume that Aggreagta actually changed itself (We don't
have so much luxury to know which column actually change - like
dynamic in Hibernate).
Problem is when dealing with large aggregates (smell) and we do not
know what has changed..../
...hmm why You don't want to use Hibernate in domain model, anyway?:P

Maciej Hadam

unread,
Feb 6, 2012, 3:52:49 PM2/6/12
to ddd-cqr...@googlegroups.com
Hibernate has much more "magic" than iBatis which I currently use.
It's not an easy decision to switch to ORM because lack of "UnitOfWork mechanism".
So, as you suggested, maybe the best way is to refactor the domain model to minimize the time of large aggregates storing operation.



2012/2/2 Sławomir Sobótka <sso...@gmail.com>
Reply all
Reply to author
Forward
0 new messages