Is it possible to implement mixins in C#?

前端 未结 9 628
感动是毒
感动是毒 2020-11-29 17:50

I\'ve heard that it\'s possible with extension methods, but I can\'t quite figure it out myself. I\'d like to see a specific example if possible.

Thanks!

9条回答
  •  醉话见心
    2020-11-29 18:33

    LinFu and Castle's DynamicProxy implement mixins. COP (Composite Oriented Programming) could be considered as making a whole paradigm out of mixins. This post from Anders Noras has useful informations and links.

    EDIT: This is all possible with C# 2.0, without extension methods

提交回复
热议问题