DCI save example (data, context, interaction)

All the DCI examples I've seen seem to be based on an object as the ultimate storage medium, and transaction boundaries are defined inside the methods.

I would like to see an example of a permanent application where there is some level of persistence, i.e. where there may be duplicate copies of the object underlying the persistence store; and where changing the object is a replacement for copies that will subsequently be saved. Does DCI work for this model at all?

+5
source share
3 answers

DCI is a paradigm and just like you can create an application using any other persistent paradigm (using pure FP, since persistence is a side effect), so you can with DCI. This is not mentioned in DCI examples, as it is not a paradigm and is not related to understanding the paradigm. (However, you are not the first to ask the question and not be the last, I am sure).

The problem of data storage is generally orthogonal to DCI. DCI is trying to break design into

  • What system
  • What does the system do

The first is the domain model, and the second is the functionality of the system. Regardless of whether the “system” is stored in memory, flat files or databases are important, but, of course, this is a separate problem and is usually implemented using limited OO

+3

DCI .

+2

http://blog.maxant.co.uk/pebble/files/dci_java_example_for_object_composition_google_group_201010052226.zip Java, JPA (ORM) .

This is a piece of white paper that will be published shortly at www.maxant.co.uk/whitepapers.jsp

The following example, showing that DCI is integrated into the application server, will be in this article. Hope this helps!

+1
source

All Articles