small medium large xlarge

10 Oct 2017, 00:28
Irfan Charania (4 posts)

How or where would you suggest adding support for optimistic locking? (so that a user gets notified another user changed something on the same record while they were working away)

A “rowversion” property isn’t something the business would be concerned with, so should it be part of the domain model?

10 Oct 2017, 20:09
Scott Wlaschin (29 posts)

That’s an excellent question, and I’ll update the book to address it.

It seems like a row version and other similar things are not really part of the domain, yes, but on the other hand, even if I was designing a purely paper system, without a database, I’d still want some sort of timestamp written on a paper form so I could tell which piece of paper was newer if there was a conflict.

So I do think it is acceptable that timestamps and other kinds of versioning aids ARE modeled as part of the domain.

Another way to think about it: if something goes wrong, who has to deal with the problem? In this case, the users themselves need to deal with it, and therefore it needs to be modeled as part of the standard user-centric workflow. Again, part of the domain I think.

It’s a tricky question though, and that’s just my opinion. Hope this helps!

11 Oct 2017, 02:44
Irfan Charania (4 posts)

Yes, it does. Thanks for the input!

You must be logged in to comment