What is the difference between an Abstract Class and a Mixin?

前端 未结 2 1100
暗喜
暗喜 2021-02-04 06:12

I just found an article on a framework in Java that apparently allows it to support Mixins and something called Composite Oriented Programming (which for all I know might even b

2条回答
  •  萌比男神i
    2021-02-04 07:00

    Mixin is never meant as stand alone class. They just add some functionality to the class you declare. In Python they can be easily applied by class decorators. For example you could decorate your class with Singleton mixin, making your class a singleton.

提交回复
热议问题