3 ms·
I've been applying DCI with my team for the past few months and have found it allows for much greater flexibility in design. We can keep our classes small and c
by lucisferre 14y ago
I've been applying DCI with my team for the past few months and have found it allows for much greater flexibility in design. We can keep our classes small and cohesive and in turn we find the code easier to understand in a lot of ways. Specifically, the fact that design can be driven by scenarios centered around the contexts gives a clear flow of logic from the controller to the domain.
In a lot of ways DCI will almost seem a bit like having a meta-MVC within your MVC application. I like to think of it as a MVC-like pattern for the domain, decoupling your domain from the infrastructure of the web-tier.
If you are unfamiliar with DCI, I'd recommend checking out the Oredev videos where it was first introduced:
http://vimeo.com/8235574 http://vimeo.com/8235574
http://vimeo.com/8235394 http://vimeo.com/8235394
Also Jim Gray is currently working on a book (I've pre-ordered and get the chapters as they are being written)
http://clean-ruby.com/ http://clean-ruby.com/
- rubyskills 14y agoThanks for these resources! I did watch some videos on infoq from James Coplien about DCI (http://www.infoq.com/presentations/The-DCI-Architecture http://www.infoq.com/presentations/The-DCI-Architecture) which was the basis for some of the Roles I'm going to talk about in the next part of my blog post. Stay tuned! :)
- rubyskills 14y agoI'm not sure I can consider it a meta MVC pattern however. They way I use it is a completely separate pattern in a completely different application. By decoupling the business layer from the delivery mechanism (the web), I can use DCI as a pattern the effectively organizes my business application and use MVC specifically for my display/web application. Although, the MVC pattern sort of breaks down when you abstract out your business layer and your infrastructure layers. It turns into something more like VC where your controllers interact with your interactors and push the data to the views depending on the interactor logic.