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

Allow override for Transformation #217

Closed
tavoda opened this issue Jan 22, 2020 · 4 comments
Closed

Allow override for Transformation #217

tavoda opened this issue Jan 22, 2020 · 4 comments
Assignees
Milestone

Comments

@tavoda
Copy link
Member

tavoda commented Jan 22, 2020

It's very useful to have possibility to override transformation phase.
We had problem with Xtend annotation processor when Transformation was annotated with our extension mechanism for overriding (@ChainOverridable). It looks like new version is working for Transformation phase.

@tavoda tavoda added this to the 3.2.0 milestone Jan 22, 2020
@tavoda tavoda self-assigned this Jan 22, 2020
tavoda added a commit that referenced this issue Jan 22, 2020
@tavoda tavoda closed this as completed Jan 22, 2020
@tjuerge
Copy link
Member

tjuerge commented Jan 24, 2020

Are you sure that the issues raised in #64 (@ChainOverridable's caches implemented as private members named _createCache_<method name>_<counter>) are gone now?

@tavoda
Copy link
Member Author

tavoda commented Jan 24, 2020 via email

tjuerge added a commit that referenced this issue Jan 26, 2020
@tjuerge
Copy link
Member

tjuerge commented Jan 26, 2020

How to test this?

With the test case DslTransformationTest.testServiceDependency() in the feature branch feature/transformation-override this issue (here the same module is created multiple times) can be tested in isolation.

@tjuerge
Copy link
Member

tjuerge commented Jan 26, 2020

Is it only for create methods?

No, it's related to state in general (explicitly via member variables or implicitly via the create methods cache implementation).

Quote from comment in #64:

Using @ChainOverridable on Xtend classes which are maintaining state (explicitly via member variables or implicitly via the create methods cache implementation) leads to strange errors like this.
This is due to the inheritance hierarchy created by Sculptors active annotation processor and maintaining separate instances: The instance of the overriding class has it's state (via extending the class annotated with @ChainOverridable) and the instance of the overridable class has it's state. Calling methods on the overriding class or the overridable class manipulates the state within separate instances of the annotated class. With create methods this leads to creation of multiple instances due to separate caches implemented as private members named _createCache_<method name>_<counter>.

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

2 participants