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? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABfX5PbfeiSrvdN0O3uczXh%2BBxsX2HBFx7pdc%3DTDxxcA%2BVchtA%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.