You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are situations, when same set of properties are used in multiple models. Repeating same properties multiple times, makes it difficult to maintain manifest tables.
To fix that, we could add possibility to include properties from other models:
model
property
type
ref
Place
id
id
integer
name@lt
string
Town
id
include
Place
City
id
include
Place
Here, Town and City includes id and name@lt from Place.
All three models have same set of properties. Properties ar defined in a single place and imported into Town and City models.
base models do not include properties, base is used to define model Entity and semantic meaning, base is also used to assigned same identifiers to different models of the same entity.
Models of the same base might have different set of properties, that is why, we need include type, to explicitly specify, properties, to be added to the model.
Includes could be also possible on top of a property, for example:
model
property
type
ref
Country
id
id
integer
name@lt
string
City
id
id
integer
name@lt
string
country
ref include
Country
Where ref include specifies, that City should incluce all Country properties on top of City/country property.
Also, source values should be joined togeter if including on top of a property, for example:
This would work in a similar way as XSD ref references.
Alternative options, how include syntax could look:
include is provided in a separate row:
model
property
type
ref
City
id
country
ref
Country
country
include
Country
Con of this option is that country property name is dublicated, but on the other hand, include is not a property type. include is a macro used to include properties from other model.
Pro of this option is that this would better allign with include on the model elvel. In this case, only property name needs to be specified, in order to include on top of a property. This gives more consistency.
Maybe ref is not needed when include macro is used?
model
property
type
ref
City
id
country
include
Country
Similarly as with the first option, ref could be inferred and there is no need to specify it explicityly. On the other hand, we might want to include on top of a backref property, in this case it is better to specify property type explicitly.
The text was updated successfully, but these errors were encountered:
There are situations, when same set of properties are used in multiple models. Repeating same properties multiple times, makes it difficult to maintain manifest tables.
To fix that, we could add possibility to include properties from other models:
Here,
Town
andCity
includesid
andname@lt
fromPlace
.All three models have same set of properties. Properties ar defined in a single place and imported into
Town
andCity
models.base
models do not include properties,base
is used to define model Entity and semantic meaning,base
is also used to assigned same identifiers to different models of the same entity.Models of the same
base
might have different set of properties, that is why, we needinclude
type, to explicitly specify, properties, to be added to the model.Includes could be also possible on top of a property, for example:
Where
ref include
specifies, thatCity
should incluce allCountry
properties on top ofCity/country
property.Also,
source
values should be joined togeter if including on top of a property, for example:Example abbove should be interpreted as follows:
This would work in a similar way as XSD
ref
references.Alternative options, how
include
syntax could look:include
is provided in a separate row:Con of this option is that
country
property name is dublicated, but on the other hand,include
is not a property type.include
is a macro used to include properties from other model.Pro of this option is that this would better allign with
include
on themodel
elvel. In this case, only property name needs to be specified, in order to include on top of a property. This gives more consistency.Maybe
ref
is not needed wheninclude
macro is used?Similarly as with the first option,
ref
could be inferred and there is no need to specify it explicityly. On the other hand, we might want to include on top of abackref
property, in this case it is better to specify property type explicitly.The text was updated successfully, but these errors were encountered: