Class Hierarchy of Entities

I: The type of the generated invalid modddel - V: The type of the generated valid modddelLet'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/InvalidModddelandBaseModddel, and also no association betweenValidEntity/InvalidEntityandEntity. That's on purpose because those interfaces can be directly implemented in some cases, and we don't want theBaseModddelmethods to be inherited. (See the models that are always valid / invalid section).
Last updated