"DCI" in Ruby is completely broken
tonyarcieri.com
"DCI" in Ruby is completely broken
1–10 of 67 posts
Re: "DCI" in Ruby is completely broken
#2I see very little reason for the dogma behind the way role injection is typically handled, yet everyone seems to be attached to doing this in Ruby. This is odd because there are DCI examples in almost every language, each one has it's awkwardness when it comes to roles, but they all manage to get it done with some workaround. I don't see why Ruby should be any different, if it wasn't possible to call #extend, we'd just do it another way.
Either way, I wouldn't dismiss DCI just because the canonical approach some academics cooked up is completely senseless in practice. In fact the author seems to agree in the end so the title is a bit exaggerated.
Re: "DCI" in Ruby is completely broken
#3Re: "DCI" in Ruby is completely broken
#4Ruby is a language, not an implementation. DCI in ruby seems just fine, but all implementations are not friendly to the dynamic mixin hell hole.
Re: "DCI" in Ruby is completely broken
#5Ruby is a language, not an implementation. DCI in ruby seems just fine, but all implementations are not friendly to the dynamic mixin hell hole.
Re: "DCI" in Ruby is completely broken
#6Can't you just have a method cache per metaclass (or class; I'm not very familiar with how Ruby factors this stuff)? Since mixing in a role into an instances creates a new metaclass anyway, there's no need to affect instances of the original class.
Re: "DCI" in Ruby is completely broken
#7Re: "DCI" in Ruby is completely broken
#8Re: "DCI" in Ruby is completely broken
#9I'm not a Ruby programmer, so maybe I'm misunderstanding the article -- are we talking about changing an object's class hierarchy after it's already been instantiated and then complaining that it's the performance aspect that is pathological? That sounds like a completely insane way of writing software to me.
Re: "DCI" in Ruby is completely broken
#10Ruby is a language, not an implementation. DCI in ruby seems just fine, but all implementations are not friendly to the dynamic mixin hell hole.
While this is true, it currently has pathological performance on all major Ruby implementations.