[英]What is Mixin Based Inheritance in Dart?
This is definition of Mixin Based Programming from the official Docs, 这是官方文档中基于Mixin的编程的定义,
Mixin-based inheritance means that although every class (except for Object) has exactly one superclass, a class body can be reused in multiple class hierarchies. 基于混合的继承意味着尽管每个类(对象除外)都只有一个超类,但是一个类主体可以在多个类层次结构中重用。
Can anyone explain this ? 有人可以解释吗?
From https://medium.com/flutter-community/dart-what-are-mixins-3a72344011f3 来自https://medium.com/flutter-community/dart-what-are-mixins-3a72344011f3
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Mixins are a limited way to reduce the limitations of single-inheritance (in contrary to for example C++ which allows multiple inheritance ) Mixins是减少单继承限制的有限方法(例如,与允许多重继承的C ++相反)
Mixins allow to inherit implementations of methods from one superclass and one or more mixin classes. Mixins允许从一个超类和一个或多个mixin类继承方法的实现。
See also 也可以看看
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.