Ryan D. wrote in post #981451:
Tho I’ve got to say that I’m not sure what DCI does that decorations
don’t. Seems this can all be done via composition and delegation quite
DCI and composition can work together very nicely in my opinion. In this
context DCI just gives you a way of not declaring all of the delegations
in one class, but split it and use and role at a time.
Let’s assume that in the Redmine codebase it’s the User class that is
responsible for most of the UI actions. In that case User would contain
lots of associations:
has_many :issues, :owned_issues, :projects, :comments, :attachments
It would probably delegate some of the logic to classes like
ProjectManager, IssueOwner, IssueReporter etc.
It’s all mixed together at the class level.
With DCI you would still have the “composition” classes/modules, but now
they will be injected runtime, so no need to have them in one place in
the User class.
I’m not sure if it’s good or bad. I like this way of thinking that now
I’m talking to “this” role of the user object, so I don’t care about
other roles. I also like the fact that the base User class is now much