Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Rewrite DefaultOpMatcher as a set of MatchingRoutines - #42

Merged
ctrueden merged 3 commits into
mainfrom
scijava/scijava-ops-api/matching-routine
Dec 6, 2021
Merged

ctrueden merged 3 commits into
mainfrom
scijava/scijava-ops-api/matching-routine

Conversation

@gselzer

@gselzer gselzer commented Sep 16, 2021 •

Copy link
Copy Markdown
Member

This PR adds the MatchingRoutine interface, an abstraction designed to increase the extensibility of the DefaultOpMatcher. Previously, DefaultOpMatcher consisted of a hardcoded ordering of matching routines: first a direct (runtime-safe) match was searched for, then an adapted match, and finally a simplified match. Other matching routines, such as the reduction routine of #32 would have to be explicitly added to this chain, or be shoehorned into one of the existing routines (the reduction routine was shoehorned into the direct routine by expanding the number of initial OpInfos).

By adding the MatchingRoutine interface, altering the order of these matching routines becomes much easier, and the routines more isolated.

TODO:

  • Merge ServiceLoader-based Discoverer #41
  • Consider using another discovery mechanism for the discovery of the various MatchingRoutines. They are currently supported by the PluginService, and it would be nice to switch to SciJava Ops ServiceLoader. This can't really be done without putting MatchingRoutine in SciJava Ops SPI, however, and I am not sure whether this is something we want to do.

@gselzer gselzer added the enhancement New feature or request label Sep 16, 2021
@gselzer
gselzer requested a review from ctrueden September 16, 2021 19:32
@gselzer gselzer self-assigned this Sep 16, 2021
@gselzer
gselzer force-pushed the scijava/scijava-ops-api/matching-routine branch from 4f885eb to 8a899e5 Compare September 16, 2021 21:21
@gselzer
gselzer force-pushed the scijava/scijava-ops-api/matching-routine branch 2 times, most recently from 13fb850 to 8a899e5 Compare September 27, 2021 16:46
@gselzer
gselzer force-pushed the scijava/scijava-ops-api/matching-routine branch from 8a899e5 to 4f885eb Compare November 15, 2021 22:15
@gselzer
gselzer force-pushed the scijava/scijava-ops-api/matching-routine branch from 4f885eb to f6eea84 Compare November 16, 2021 19:18
@ctrueden ctrueden assigned ctrueden and unassigned gselzer Nov 22, 2021
typesMatch() shouldn't really pertain to the OpMatcher. It might instead
belong in OpCandidate, or in RuntimeSafeMatchingRoutine... TBD.
@ctrueden
ctrueden force-pushed the scijava/scijava-ops-api/matching-routine branch from f6eea84 to bb317a5 Compare December 6, 2021 23:15

@ctrueden ctrueden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that later work transitions the MatchingRoutines (and other plugin types) away from SJC2 in favor of JPMS service loader discovery, so I think this branch is good to go.

@ctrueden
ctrueden merged commit dd98459 into main Dec 6, 2021
@ctrueden
ctrueden deleted the scijava/scijava-ops-api/matching-routine branch December 6, 2021 23:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants