-
Notifications
You must be signed in to change notification settings - Fork 2
First draft of languages to describe issues / findings #89
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
base: mps2021.1
Are you sure you want to change the base?
Conversation
I just looked at the diagram you shared on slack and I do not understand why there are subclasses of I would consider making severity an enum, as in this way one could write applications that deal with the expected level of severity, that are all predefined. While if we have an interface called |
You've immediately found the biggest issue with my draft (-: The severity is indeed duplicated, as I was unsure how to represent it myself (I changed it forth and back a few times). I think there are two independent issues here: A) Do we represent severity as field or interface?Currently it's a mixture: The advantage of using interfaces to represent severity is that it's completely in the structure, no instance level needed. This simplifies model management -- we need only a language, no "accessory model". The advantage of a field is the the general preference "composition over inheritance", and more flexibility. This highly relates to B). B) How do we represent the field values?Currently, an
The advantage over an enum is the space we leave for other severities, e.g. Of course, we could also say "everything should fit into one of these three buckets" -- then an enum would fit perfectly. |
I would choose to represent it using a field. We can use either a enum property if we think this is a fixed list. Otherwise I would opt for a string property with as list of predefined values. That opens up the possibility to use additional values. Not sure whether we should. I don't like the integer property, it is basically meaningless and the order is in my opinion irrelevant. |
Location language: - Separating out the location language is a good thing. The location language should become a separate language on its own, useful to reuse in e.g. the LionWeb Differ, and probably other places as well. |
Recoverability: - I think we should not say anything about recoverability in the language. What is recoverable depends very much on the application using LionWeb. |
But for certain classes of issues – i.e.: the low-level JSON ones – we certainly can say something about recoverability. (Maybe we should “finalize” the correctness document as much and soon as possible?) |
Even if we can, we should not say anything about it in the validation language. If we want to say anything at all I would put this in the validation correctness document only. The validation language should be concise, only reporting the findings. |
As with severity, I would also put the level (Serialization, Hierarchical, metaStructural, …) in a (enum or string) property. |
Two presentations points:
|
I agree, and removed |
It's not in the core validation language, but the serialization validation language. I agree with Meinte, it makes sense in that context.
|
I would also argue that enum literals have an order of definition within the enum declaring that, and we could use that order |
This is what we do in StarLasu. Each issue has an IssueType (one of |
Not sure what you mean by "core validation language: vs "serialization validation language"? Can you explain? |
These cases are usually either already recovered by the JSON parser or marked as an error by the JSON parser used. We decided to just follow the JSOIN spec, so these errors are not even LionWeb errors. |
Two points:
|
"core validation language" is the base of all validation (reporting). A client would ask for the derived model by this language to get all validations (as we've decided a long time ago to identify derived models by their language). It defines very basic classifiers used in any kind of validation. "serialization validation language" is an extension of the former. It's used specifically to report issues found in serialization. |
The errors would still need to be reported. And all error reports are nodes, so they need a concept. |
I didn't mean I want to write exactly that code, but want a way to filter for e.g. completely recoverable findings. |
As I argued before, I don't think recoverability is a findings property, it is a property of the application whether it can or cannot recover from something. |
I agree that they should be reported, but the discussion here is about whether JSON findings are recoverable or not. |
In general, I consider "marker" interfaces (those without any features) as an anti-pattern. I know they are heavily used in MPS, but I never liked them. I would like to replace all the marker interfaces with properties (as has already been discussed for all of them somewhere above(. |
Changes in latest commits:
Now the advantage of marker interfaces is clear -- I can't know from the language which severity each finding is. |
…ing enum properties instead.
Added n alternative version of the Findings (and related) languages in the folder |
No description provided.