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

Do we really want to prevent opening multiple times the same class? #161

Open
echebbi opened this issue Jun 27, 2020 · 2 comments
Open

Do we really want to prevent opening multiple times the same class? #161

echebbi opened this issue Jun 27, 2020 · 2 comments
Labels

Comments

@echebbi
Copy link
Collaborator

echebbi commented Jun 27, 2020

Context

Opening several times the same class results in an error:

image

However I don't understand the rational behind it. To solve the issue it seems that we have to use the extends keyword as follows:

open class StateMachine {

}

open class StateMachine extends StateMachine {

}

which doesn't make any sense to me.

I think we should allow it, but maybe add a marker on the ruler to warn about the class already being open & to provide quick access to the other location.

Notes

For the record, this validation is done here.

@dvojtise
Copy link
Contributor

dvojtise commented Jun 27, 2020 via email

@echebbi
Copy link
Collaborator Author

echebbi commented Jun 27, 2020

I agree we may want to open it several times but most probably in 2 different ale files in order to create 2 aspects. Each contributing some new features for different purposes

I think that's important to support this scenario. We may also decide that an EClass shouldn't be open more than once in a single source to enforce some "best" practices but in that case we should also forbid this strange extends-workaround.

Remaining tasks:

  • Allow to open the same EClass when the aspects are defined in different source files
  • Decide whether we want to allow or forbid to open an EClass multiple times in the same source file

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

No branches or pull requests

2 participants