I want to code my own Map class. MapBase and MapMixin have similar documentations. Which one should I use to code my own Map class? And why?
I understand MapBase has more functions because it implements MapMixin. However, the functions in MapBase don't seem to be important because all of its functions are static.
...
/// A basic `Map` class can be implemented by extending this class and
/// implementing `keys`, `operator[]`, `operator[]=`, `remove` and `clear`.
/// The remaining operations are implemented in terms of these five.
...
abstract class MapBase<K, V> extends MapMixin<K, V> {
...
/// A basic `Map` class can be implemented by mixin in this class and
/// implementing `keys`, `operator[]`, `operator[]=`, `remove` and `clear`.
/// The remaining operations are implemented in terms of these five.
...
abstract class MapMixin<K, V> implements Map<K, V> {
CodePudding user response:
It does not really matter. The advantage with the mixin is that you can include multiple mixins in your class where you can only extend from one class.
