Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DCI (data, context, interaction) persistence example

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?

like image 858
nilskp Avatar asked Jul 01 '10 14:07

nilskp


1 Answers

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

  • What the system is
  • What the system does

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

like image 77
Rune FS Avatar answered Sep 30 '22 13:09

Rune FS