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

[Bug] Error when listing elements by type when Note is present #82

Closed
sdasda7777 opened this issue Nov 4, 2022 · 3 comments · Fixed by #89
Closed

[Bug] Error when listing elements by type when Note is present #82

sdasda7777 opened this issue Nov 4, 2022 · 3 comments · Fixed by #89

Comments

@sdasda7777
Copy link
Contributor

image

image

image

@sdasda7777
Copy link
Contributor Author

@JanBliznicenko I tried looking into this as well, but I'm not completely sure how to approach it. It would definitely be possible to just add these methods to Note, but I don't think that's exactly a good idea from object design perspective. Another solution might be to not show Notes on there at all, but someone might want to be able to hide them, so it's also probably not the best. Last option I can think of would be to add all elements something like a "displayName" method, and return umlClassName in UML elements and "Note" for Notes.

@sdasda7777
Copy link
Contributor Author

sdasda7777 commented Jan 24, 2023

Two more things:

I noticed that OPNote and OPUMLElement actually don't share any class in the hierarchy besides Object - that means that for the third approach the hierarchy would probably also have to be reworked (having two completely unrelated classes have methods sharing name and calling the two unrelated methods based on the object at hand just screams bad OOP, imo).

I also noticed that OPNote doesn't have option to hide it, unlike most of the objects. That means the second approach might actually be the correct one?

@JanBliznicenko
Copy link
Member

Yes, the Note (and Boundary) are a little special. While all the other elements are parts of the model (root UML package in this case), Note and Boundary are completely outside of the model (even though they have model classes OPNote and OPBoundary).
And as you correctly say, they should not even support the hiding and showing, because "show" basically means "create diagram representation of the model element" and "hide" means "remove diagram representation of the model element, but keep the model element itself". Since note and boundary are not model elements, hide = remove and show makes no sense.

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

Successfully merging a pull request may close this issue.

2 participants