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

Can we have multiple instances of the same Annotation associated to a certain Node? #32

Closed
ftomassetti opened this issue Nov 4, 2022 · 10 comments

Comments

@ftomassetti
Copy link
Contributor

Let's suppose that I have an Annotation called DocumentationComment. Can I have multiple instances of this Annotation associated to the same Node? Is this true for all the Annotation or should this be something we define for each Annotation?

@ftomassetti ftomassetti added the M3 label Nov 4, 2022
@dslmeinte
Copy link
Contributor

I think there's not much to be gained by having this constraint. It's a constraint that M2-authors can put in themselves, if they like.

@ftomassetti
Copy link
Contributor Author

Ok, so in general we should allow for multiple instances of the same Annotation to be associated with a certain Node.

@ftomassetti
Copy link
Contributor Author

It's a constraint that M2-authors can put in themselves, if they like.

Does this mean that we should have a flag multiple added to the Annotation declaration?
This would allow the M2-authors to specify this constraint

@dslmeinte
Copy link
Contributor

I would leave it unspecified (in the M2), and just allow multiple instances of the same Annotation being applied to a particular Node (in the M1). If constraints are necessary these should be specified next to/in conjunction with the M2 (in a nice constraint language which we need to have anyway).

@enikao enikao added Annotation postponed Postponed for later discussion labels Nov 25, 2022
@enikao
Copy link
Contributor

enikao commented Oct 10, 2023

I think we decided on this in #13: An Annotation has a multiple flag, so we might have multiple instances of the same Annotation on the same Node.

@enikao enikao removed the postponed Postponed for later discussion label Oct 10, 2023
@dslmeinte
Copy link
Contributor

I'm reluctant to say anything more about this, but: Is it even necessary to have a multiple flag? It seems like it's not our business to restrict this: if it makes sense for someone to restrict an Annotation to be used (at most/exactly) once, then that'd be a constraint.

@enikao
Copy link
Contributor

enikao commented Oct 10, 2023

In the end it is only a constraint -- we can still have an (invalid) model that has two instances of the same annotation (with multiple = false) on one node.

I don't recall the discussion around this exactly. One argument was the influence on APIs (getDocu(): Docu vs. getDocu(): sequence<Docu>).

Shall we raise this again next week?

@dslmeinte
Copy link
Contributor

When to call a model "valid" is also still very much up for debate, so we might want to tackle that one first ;)

@enikao
Copy link
Contributor

enikao commented Oct 27, 2023

Latest round of discussion on 2023-10-27

In general: We don't have enough experience to make an informed decision.

Pro (having multiple flag):

  • Language designer can ignore the flag (i.e. never set it to false), that effectively works as if the flag would not be there
  • Code generators can create nicer APIs (getDocu(): Docu vs. getDocu(): sequence<Docu>).

Con:

  • It's easier to add this flag in a later LionWeb version than remove it.

@enikao
Copy link
Contributor

enikao commented Mar 23, 2024

We've decided some time ago not to have Annotation.multiple flag.
This means we don't limit how many instances of the same annotation concept can be attached to one node.

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

No branches or pull requests

3 participants