Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [incquery-dev] docs update, api refactor ideas, uggested meeting topics

Hi,

-----incquery-dev-bounces@xxxxxxxxxxx ezt írta: -----
1. since the source code of the Match and Matcher classes are already mangled, couldn't we just add the most important inherited methods, such as getAllMatches() ?

getAllMatches is actually included there. What else would you like to see that is not there at the moment?

I meant getAllMatches() - the version without parameters. 
Similarly, I think we should see at least getOneArbitraryMatch(), hasMatch(), countMatches(), forEachMatch(processor), forOneArbitraryMatch(processor)

Btw. I'm still looking for a _good_ suggestion on how to "include" inherited methods (other than pointing to the Javadoc, which is what we have now).

Well, in the worst case we can just "lie" and copy these methods into the class body, as if they were declared there.
And instead of extends BaseGeneratedMatcher, we could say implements IncQueryMatcher, to suggest the generic interface.
We could do the same for the Match class.

6. the generic API is demonstrated with the pattern FQN, which is only useful if the corresponding matcher factory has been registered, which typically happen with generated matcher factories only. In case of Patterns cobbled together at runtime, parameterize the matcher factory with the Pattern - especially that the comments explicitly say this.

very good point. the question is
- is this a supported/endorsed use case now?
- is there any working example on how to do this?
 Isn't this how the Query Explorer displays matches for patterns loaded from .eiq? 

7. in the same code block, the null check should rather be done on the matcherfactory, right?

right, I adjusted the code and while doing so, I discovered some additional generics issues (note included in https://trac.inf.mit.bme.hu/VIATRA/wiki/IncQuery2/Meetings/20130416)
This has come up last week as well. MFR is simplified to IMatcherFactory<?> at the moment.
Pro: a bit simpler.
Con: more difficult to use.

Refactoring to a strictly typed version is possible, the question is whether we should do it.

Anyway, does 
  IMatcherFactory<? extends IncQueryMatcher<? extends IPatternMatch>> factory
help maybe?

Cheers
Gaben




Back to the top