Mixins in C# 3?

Back to a favorite old topic of mine.

At the SweNug architecture summit I heard that Microsoft is considering adding support for mixins in C# 3... I discussed this with Anders Hejlsberg not so long ago (less than a year) and he didn't seem too keen at that time. Perhaps he has changed his mind. Or perhaps it was just the implementation proposals I discussed that he didn't like.
;-)

Here are a few quotes from friends of mine regarding the possibility of mixins:
  • Ingemar Lundberg: "Decomposition on steroids."
  • Rickard Öberg: "The best of both worlds, expose a coarse grained API, implement it fine grained."
There are several different approaches of course. A common solution is to support mixins with the help of multiple inheritance, but I think Stanley Lippman at Microsoft made it pretty clear in a series of blog posts that he, ehrm, wasn't fond of that.
:-)

The AOP people call it AOP Introductions and it's commonly implemented with some dynamic proxying technique. Think of it like if you say that your class implements a certain interface, the class also gets the implementation of that interface automatically. So you would not need the tedious forwarding code that is so common in situations like this where you just need to delegate the calls to a generic class.

Another solution would of course be to solve it with DSL. I heard a rumor today that that delegation is something Microsoft is currently working on to solve with DSL. Perhaps that's the solution that the C# 3 rumor was touching on? We'll see...

It's just typical - wanting C# 3 way before C# 2 has been released, eh?
:-)