[Rails] Re: My alternative to the DCI principle
guirec c. wrote in post #1111167:
> Hello,
>
> In the DCI principle, I like the Roles. It enable to have a skinny model
> with a single responsability (the persistence of the data).
>
> I don't like the context. It can be useful for some specific cases like
> in
> this article :
> http://mikepackdev.com/blog_posts/24-the-right-way-to-code-dci-in-ruby.
> But
> I don't want to have something like this :
>
https://github.com/randx/rails-dci-example/blob/master/app/controllers/documents_controller.rb.
> It's too complicated for nothing.
>
> I have an alternative here : https://gist.github.com/GCorbel/5699834. It
> use service objects with roles. I think it's the best of both worlds.
>
> What do you think?
This sums up what I think better than I could ever explain it myself:
http://www.martinfowler.com/bliki/AnemicDomainModel.html
Count me out as a fan of service objects.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1c3a3f92edce31eaaa171cbf012423c0%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home