+1 for the abstract type as it helps to simplify driver-logic. Additionally this "abstract" type enhances the capability to add information where it is needed and makes it more transparent. While currently it is "hidden" in the driver-logic code doing checks "if" this constraint is met etc.
Am Sa., 25. Jan. 2020 um 11:32 Uhr schrieb Christofer Dutz < [email protected]>: > Hi, > > all … as you probably all know, in the past months I have been a quite > intense user of mspec and our code-generaton. > There I have encountered situation, where I would like to add new types of > fields or change things. > > Not I just had an idea that would simplify a lot of things: > > * A field type “abstract” … it has a type and a name same as a simple > field. > > However it doesn’t actually parse anything. It just adds an abstract get > and set method for a given property to the base class. > > If a discriminated type has an “abstract” field with a given type, all > sub-types are required to somehow provide a field of the same type with the > same name. > > I think this could simplify a lot of driver-logic code (Currently I > usually to cascades of instance-of checks). > > Chris >
