-
Notifications
You must be signed in to change notification settings - Fork 1
Have a default way to manage derived properties of nodes #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I actually don't remember that we decided to keep this outside of M3. I can live with it, and maybe I was asleep for a moment :-) |
I'd prefer to keep these kind of functions that work across a whole model separate from just the metamodel. |
I wil copy here something I shared on Slack as I think it is relevant to this discussion. Let's assume that This is very similar to the approach we have been using in Kolasu (our library for ASTs) for years. We defined derived properties like that: This approach is very convenient for us, because there is no generation involved. We do not need to define the metamodel and generate Kotlin code from it, we define instead the Kotlin code and derive the metamodel from it. In this case defining |
I could even see us not defining derived properties in the M2 at all. Instead, we'd define those on top of an M2. That would also be convenient as a separate model query language. With derived properties, some derivations live in the M2, while others live outside of it. |
What I remember is that we did not want to have the logic to calculate the derived values in the metamodel, but I am not sure if we decided not to have even the declaration of derived feature (with implementation left outside). I am fine with both having just the declaration or leaving them outside of the metamodel |
Not enabling to define derived features in the M2 is a personal preference of mine. I'm not sure whether it's shared. |
Is this about derived models, not only properties? Then we should add derived tag. |
I think this particular should just fold into the bigger work for derived models, without a need for this small context. So, let's close it. |
Will be discussed as part of #181. |
Should close this |
Examples:
Option A: Represented as
DerivedFeature
Pro:
Con:
DerivedProperty
and native custom types in M3, e.g. if interpretation result can be any JavaObject
.We don't want these aspects to creep into M3.
Option B: Represent as separate aspect outside M3
Pro:
Con:
Decision: Option B
Rationale:
The text was updated successfully, but these errors were encountered: