On 24/02/2011, at 11:12 AM, Bodaniel Jeanes wrote:
In the same sort of vein as MVC and keeping controllers skinny, have
you guys read this blog post about applying DCI (data context
interaction) to Rails MVC: http://andrzejonsoftware.blogspot.com/2011/02/dci-and-rails.html?
I found it very interesting approach (especially for larger scale
projects) but haven't seen much chatter about it so I thought I'd
throw it out here to see what other people think.
I hadn't seen this post or the acronym before, but this is really
not a new invention. It's just traits, which I (and others) have
used in designing systems for more than a decade. It does seem
to work nicely with Ruby though.
Regarding the model/controller debate, in my view a controller is
responsible for animating the process model. I.e. is this request
valid in this context, and what should we do next? Everything it
needs to know to direct that decision must come from outside the
controller's context. There are four sources of such information
that I identify: The request parameters, the session, the database,
and the current configuration of the system (this includes the
current time). Sometimes external systems also contain relevant
state. You might also separate out the authorization data as a
separate data source.
Ultimately however, every controller decision is essentially based
on a query which spans those fact sources. If each such source
supported a single query interface, then controllers could be built
on top of explicit query statements. I modelled a system like this
once (although it was actually built in standard Rails), and the
exercise was very interesting. I think it's a fruitful direction for
further work.
Clifford Heath, Data Constellation, http://dataconstellation.com
Agile Information Management and Design.
--
You received this message because you are subscribed to the Google Groups "Ruby or
Rails Oceania" group.
To post to this group, send email to rails-oceania@googlegroups.com.
To unsubscribe from this group, send email to
rails-oceania+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.