vitruv-tools / Vitruv-DSLs

Languages for Specifying Consistency Preservation Rules
Eclipse Public License 1.0
2 stars 4 forks source link

Parameterize routines with generic facades #46

Open HeikoKlare opened 2 years ago

HeikoKlare commented 2 years ago

Currently, an AbstractRoutine provides a subtype of AbstractRoutinesFacade via a method returning an according generically typed argument. https://github.com/vitruv-tools/Vitruv-DSLs/blob/62e38271996ba000554bca1039d67b71148f7948/bundles/tools.vitruv.dsls.reactions.runtime/src/tools/vitruv/dsls/reactions/runtime/routines/AbstractRoutine.xtend#L33-L35

Since this requires an unsafe cast and thus depends on proper implementation and code generation to work without throwing runtime exceptions, we have to check whether it is possible to make the whole class generically types with the facade such that we achieve static type safeness.

Source:

Why can't we make a generic class to have this explicit?

_Originally posted by @JanWittler in https://github.com/vitruv-tools/Vitruv-DSLs/pull/42#discussion_r936320911_

HeikoKlare commented 2 years ago

The essential fix is quite easy (see #48), but it somehow breaks code generation from the Commonalities language. We have to figure out what the problems with the generator is (or remove the Commonalities language from active maintenance) before the fix in #48 can be applied.