|
|
|
|
Re: [Xcore] access field instead of getter [message #1759765 is a reply to message #1759759] |
Tue, 18 April 2017 09:37 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
No you can't move things, only repost them, but I see the questions in this forum too. As you say, Xcore has its limitations. So, for example, the body of any operation or derived accessor is effectively scoped/compiled against the API (interface) of that XClass, so things that are visible only in the actual Impl class are not visible in the bodies. E.g., fields, or protected methods or anything else not visible in the interface (even suppressed visibility features).
I'm not actually sure what exactly you're trying to express. It seems you model @Invalid explicitly, so you need something that models exactly this state, without derivation based on containers. And that you need a different operation that determines "effectively valid" based on the explicit state of the Group itself and the explicit state of each containing Group. But that's what you did with your first example, which you say isn't very safe in a generator, but I don't understand why that's a problem. Of course the overall derived computation depends on the overall state at that point in time...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [Xcore] access field instead of getter [message #1759769 is a reply to message #1759765] |
Tue, 18 April 2017 10:46 |
Marc Schlegel Messages: 69 Registered: July 2009 |
Member |
|
|
Thanks Ed
The problem with my first approach is code-completion: a developer might just call invalid which would be the state of the current group where he should call the operation valid.
I tried using @GenModel(suppressedGetVisibility="true") on invalid in order to hide the getter, but then the derived getter for valid also doesnt have access to it (there already is a bug for this). This should be what I need, the getter is unavailable on the interface and the setter still is, so Xtext can manipulate the state.
I was hoping there is another way.
[Updated on: Tue, 18 April 2017 10:54] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04096 seconds