Menu Close

I missed Mixins in Java today

Note to Sun: I missed being able to do mixins with Java today. Maybe it’s all this playing with Rails, but back in Java-land I had this particular problem and I thought – mixins would solve this. But no go. Not even with JDK 1.5.

I guess I’ll just put on my monkey coder hat and add decorator scaffolding and almost-identical configuration code for 50 different classes instead. Maybe I should switch back to Spring autowire (like he Rails folks say, value convention more than configuration, right?). šŸ˜›

Yes, I know that you can do it using interfaces, but it still leaves me changing more than one line in all 50 classes. I also know that you could use some fancy AOP or dynamic proxying, and go against the GrainOfTheLanguage and end up with something that “works”, but it’s a pain to run through the debugger and determine basic intent.