Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Talk
Conversations
About
Send feedback
Help
My alternative to the DCI principle
21 views
Skip to first unread message
Guirec Corbel
unread,
Jun 3, 2013, 2:21:01 PM
6/3/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
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?
Robert Walker
unread,
Jun 4, 2013, 3:44:21 PM
6/4/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
guirec c. wrote in post #1111167:
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/
.
Reply all
Reply to author
Forward
0 new messages