Skip to content
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

Derived attributes in BUML #206

Open
ademait opened this issue Feb 6, 2025 · 2 comments
Open

Derived attributes in BUML #206

ademait opened this issue Feb 6, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@ademait
Copy link

ademait commented Feb 6, 2025

Is your feature request related to a problem?

There is no way to set derived, calculated attributes.

Describe the solution you'd like

We could use the notation used in UML for derived attributes (slash before the name), and then use an annotation to set the way it is calculated. In the Web Modeling Editor we could use the same boxes are used for OCL (if possible, since there is also the "check OCL" functionality).

Describe alternatives you've considered

For now, what I have done is use OCL to set a restriction to the derive attribute. For instance, if we have a Product class with two attributes for price, one without tax and another with tax, and an attribute for tax, I write:

context Product inv:
self.price_with_tax = self.tax*self.price_without_tax

Additional context

@ademait
Copy link
Author

ademait commented Feb 6, 2025

The alternative I proposed is only for the model (visual), since the OCL constraint can only be checked with the object model.

@ivan-alfonso ivan-alfonso added the enhancement New feature or request label Feb 14, 2025
@jcabot
Copy link
Collaborator

jcabot commented Feb 16, 2025

Linked to #228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants