Let's say you want to create a Person
Entity. Person
will either directly extend SimpleEntity
, or it will extend a subclass of IterableEntity
or Iterable2Entity
. They are all subclasses of Entity
, which is a subclass of BaseModddel
(the base class of all Modddels).
ValidPerson
, which extends Person
, will implement ValidEntity
, which implements ValidModddel
.
InvalidPerson
, which extends Person
, will implement InvalidEntity
, which implements InvalidModddel
.
NB 1 : The generated classes (
Person
,InvalidPerson
...) will define other properties and methods than the ones already defined by the superclasses. (Ex:map
,maybeMap
,copyWith
... and all the others)NB 2 : Notice how there is no association between
ValidModddel
/InvalidModddel
andBaseModddel
, and also no association betweenValidEntity
/InvalidEntity
andEntity
. That's on purpose because those interfaces can be directly implemented in some cases, and we don't want theBaseModddel
methods to be inherited. (See the models that are always valid / invalid section).