When I generate code from StructureDefinition
s, it would be obvious to use the class for the resource referenced in base
as superclass.
A resource that is based on another resource can change the the type of a property of the base
resource (for example from String
to List<String>
if max="0"
is overridden by max="*"
).
This would break in strongly typed languages because a subclass has to conform to the interface of the super class (can only specialize but not generalize).
What would be the correct strategy to deal with that?
I can use snapshot
instead of differential
and not extend the class of the base
resource.
Should I still extend one of the more general super classes like Element
, BackboneElement
, Resource
, DomainResource
?
Are there any flaws in my reasoning?