All the examples of DCI I've seen seems to be based on the object as the ultimate holder of information, and the transaction boundaries are defined inside the methods.
I would like to see an example of a persistent application, where there is some sort of persistence layer, i.e. where there can be duplicate object copies of the underlying persistence storage and where a change to an object is a change to a copy that will later be persisted. Does DCI work for that model at all?
DCI is a paradigm and just as you can build an application using any other paradigm with persistence (execluding pure FP since persistence is a side effect) so can you with DCI. It's not mentioned in DCI examples because it's not a concern to the paradigm and is unrelated to understanding the paradigm. (That said you're not the first to ask the question and will not be the last I'm sure).
The concern of persisting data is in general ortogonal to DCI. DCI tries to partition the design into
The first is the domain model and the second is the functionality of the system. Whether "what the system is" is kept in memory, flat files or a DB is important of course but a separate concern and is usually implemented using restricted OO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With