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

OppositeEndFinder injection (#100) #110

Open
StephanErb opened this issue Aug 23, 2011 · 2 comments
Open

OppositeEndFinder injection (#100) #110

StephanErb opened this issue Aug 23, 2011 · 2 comments

Comments

@StephanErb
Copy link
Member

Currently, OppositeEndFinder objects of specific subclasses (such as Query2OppositeEndFinder) are obtained throughout the code. As we keep seeing issues with the current query2 implementation, changes were performed that now additionally use DefaultOppositeEndFinder as implementation in some places (see, e.g., http://lists.furcas.org/pipermail/furcas-discussion/2011-March/000185.html). This runs danger of creating major inconsistencies.

We need a clean way of injecting a consistent OppositeEndFinder or a corresponding factory into a FURCAS implementation.

@StephanErb
Copy link
Member Author

Stephan Erb ([email protected]) wrote on 2011-03-15 11:52:48

The idea should be to never instantiate a custom OppositeEndFinder but to always require one within the constructor. An appropriate OEF can be constructed within the editor and injected all the way down. The IMP Editor tries to stick to this schema.
 
Classes known to still instantiate a custom OEF (hidden in the TCSSpecificOCLEvaluator):
 * PrettyPrinter
 * ShortPrettyPrinter
 * ContentAssist
 
However, there are some special cases where we might want a specific OEF that only operates on the current resource set. For example, it might not always be wanted to find all TextBlocks but it is often sufficient to just find the one within the current textual view. I believe that the change performed by Sebastian falls into this category. 

@StephanErb
Copy link
Member Author

Axel Uhl ([email protected]) wrote on 2011-03-15 12:10:45

(In reply to comment #1)
> The idea should be to never instantiate a custom OppositeEndFinder but to
> always require one within the constructor. An appropriate OEF can be
> constructed within the editor and injected all the way down. The IMP Editor
> tries to stick to this schema.
> 
> Classes known to still instantiate a custom OEF (hidden in the
> TCSSpecificOCLEvaluator):
>  * PrettyPrinter
>  * ShortPrettyPrinter
>  * ContentAssist
 
I've found usages of Query2OppositeEndFinder.getInstance() in AbstractGrammarBasedEditor, CtsDocument and LinkHelper. What about those?
 
> However, there are some special cases where we might want a specific OEF that
> only operates on the current resource set. For example, it might not always be
> wanted to find all TextBlocks but it is often sufficient to just find the one
> within the current textual view. I believe that the change performed by
> Sebastian falls into this category.
 
Good. Then I think there should be a useful comment that makes this thought explicit whenever an explicit non-injected selection of an OEM implementation is made.

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

1 participant