DCI in Ruby A sample application illustrating the Data Context Interaction paradigm (in Ruby)
DCI (Data Context Interaction) is a new way to look at object-oriented programming. Instead of focusing on individual objects, the DCI paradigm focuses on communication between objects and makes it explicit. It improves the readability of the code, which helps programmers to reason about their programs.
I’d been reading blogs posts and watching talks about DCI for a long time and I felt that it’s time to try it out. I found that most material related to DCI is theoretical. There were a few books, a dozen of blog posts, and several presentations that could give you a good picture of what DCI is. However, I could not find any “real world” examples of actually using it. That’s why I decided to write a simple application showing how to implement DCI in Ruby.
Like the following projects:
DDDSample. This is a how-to example of implementing a typical DDD application.
The Silverlight Cookbook. A reference application for Silverlight 5 LOB apps.
The application is a Rails project. There are a few reasons for it:
- All the DCI concepts can be implemented in Ruby. It doesn’t feel clunky or alien.
- Ruby is concise and readable. Even if you are a C# programmer, you should be able to understand what is going on.
- There is more interest in DCI in the Ruby community than in any other community.
This is not a book
Just to make it clear; this is a practical application of the DCI pattern, not a book. If you want to read up on DCI check out the following links:
The purpose of this project is to show a typical DCI application. There are many ways to implement any design pattern, and DCI is not an exception. Hence, the application isn’t meant to show the way to use DCI, but just to illustrate one of many possible approaches.