-
Notifications
You must be signed in to change notification settings - Fork 105
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
Added extend feature to information model dsl #932
Conversation
Signed-off-by: Simon Pizonka <simon@pizonka.de>
So if I Want to just add constraints like min max to an existing property, How would that look like ? |
This is a tough decision. I see to potential options: Option 1: Option 2: For me option 2 would fits best. We assume that most people have used a OOP language. This would give the same experience. Maybe a bit more verbose but easier to understand. Example for option 2:
Adding constraints to
|
Hi @Ebolon Btw: travis ci is failing because of failing unit tests in repository-java client. Can you take a look :-) ? |
I agree there should be a wrapper class for this.
I will have a look. The build works somehow on my machine. |
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Hi @Ebolon |
Yep, will have a look next week. |
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Added validation for all properties (status, events, etc.) and operations which can be defined in a FB. The error messages could be improved in the future. |
Cool. Thanks @Ebolon |
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Signed-off-by: Simon Pizonka <simon@pizonka.de>
eecc9cb
to
233b93e
Compare
Looking at your validation, it seems that it is not checking if there is a clash of a constraint and with statement ? It could be that the base property defines eg a MAX constraint which the overridden property should not be able to override. Same applies for with statement |
For the constraints I have the idea that it would be feasible to tight boundaries. Here an example:
How do you think about that? I am not 100% sure how the validation should behave for the with-block. For example:
Should it be ok to change When there is a clash between constraints an with-block? |
@Ebolon |
Here is my proposal:
For the with-block I agree. If any keyword is already defined it can not be overwritten. |
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Signed-off-by: Simon Pizonka <simon@pizonka.de>
Signed-off-by: Simon Pizonka <simon@pizonka.de>
835f242
to
7a1c004
Compare
Signed-off-by: Simon Pizonka <simon@pizonka.de>
@aedelmann: I have added the intended validation functions for property attributes and constraints. Maybe you can have a look if they work like you would expect. I create the necessary units test afterwards. |
@aedelmann: Any chance you could have a look at this near-term? Would like to go forward and implement the extend feature for all generators. |
Signed-off-by: Simon Pizonka <simon@pizonka.de>
As discussed I close this pull request now. I will create a new one and remove the inline extend and including only the |
As discussed in #823 it can be helpful to extend/override attributes of a function block in an information model. The
with
keyword is already used in another context to give a property additional attributes. Thats why the keywordextend
is used. In andextend
block all features of a function block can be used. Other like the proposed idea the fields status, etc. are retained because property names between sections are not unique.Example:
The feature could be implemented similar for data types in a function block in the future.