You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpInfo, OpInstance, InfoChain, RichOp – as well as what objects we are going to name "op". Is it only the raw objects that are instances of functional interfaces? Or can we name instances of any of the above classes "op"? In the docs, which types of things do we refer to as "op"?
A really important aspect of this naming is: what is the relationship between each of these types of objects? 1-to-1, or many-to-1? Any time we have a 1-to-1 relationship, we should consider whether the two concepts can be combined. And for many-to-1, document clearly on the "many" object side that it is an instance of (or similar language) the 1.
Op: A marker interface for any Op that satisfies Op properties. Deterministic, one output, has a name, does not mutate inputs, etc. Raw algorithms that are Ops (read: satisfy these properties, allowing us to call them from the Ops framework) do not need to implement this interface, in fact, that would limit the scope of the project.
OpInfo: An interface that knows how to obtain an instance of the Op.
InfoChain: A tree, where each node is an OpInfo and that node's children are the OpInfos for its dependencies. Each node knows how to generate a fully-injected (in terms of Op dependencies) instance of the Op it knows about. I hesitate to rename it ResolvedOp or MatchedOp because it has no Ops, only OpInfos.
OpInstance: An instance of an Op, which also knows about the InfoChain that created it. Side note, it implements GenericTyped. Maybe we ought to move that interface over to RichOp...
RichOp: An OpInstance with metadata (OpMetadata, specifically) about how this Op functions. This metadata includes the OpHistory this Op uses to record progress, the Hints used to match it, etc.)
In Minimize and proof SciJava Ops API & SPI incubator#90, I renamed OpMatchingException -> OpRetrievalException, but we decided that we like the former name better. We should also make an OpException extends RuntimeException that OpMatchingException, OpExecutionException, etc. all extend.
Optional -> Nullable - it's a bit of a convention among third party Java libraries, and it's also clearer about what the argument will be if the user doesn't pass it. And we don't clash with the java.util.Optional class.
Activity
ctrueden commentedon Dec 6, 2021
InfoChainis a resolved op.ResolvedOporMatchedOpcould be good names, if we are keepingOpas a suffix for classes like this.ctrueden commentedon Dec 6, 2021
A really important aspect of this naming is: what is the relationship between each of these types of objects? 1-to-1, or many-to-1? Any time we have a 1-to-1 relationship, we should consider whether the two concepts can be combined. And for many-to-1, document clearly on the "many" object side that it is an instance of (or similar language) the 1.
ctrueden commentedon Dec 6, 2021
As mentioned in this comment: we could consider combining
RichOpandAbstractRichOpinto a single abstract base class. Who needs interfaces? 😜ctrueden commentedon Dec 6, 2021
gselzer commentedon Jan 14, 2022
Here is my impression of these types:
Op: A marker interface for any Op that satisfies Op properties. Deterministic, one output, has a name, does not mutate inputs, etc. Raw algorithms that are Ops (read: satisfy these properties, allowing us to call them from the Ops framework) do not need to implement this interface, in fact, that would limit the scope of the project.OpInfo: An interface that knows how to obtain an instance of the Op.InfoChain: A tree, where each node is anOpInfoand that node's children are theOpInfos for its dependencies. Each node knows how to generate a fully-injected (in terms of Op dependencies) instance of the Op it knows about. I hesitate to rename itResolvedOporMatchedOpbecause it has no Ops, onlyOpInfos.OpInstance: An instance of an Op, which also knows about theInfoChainthat created it. Side note, it implementsGenericTyped. Maybe we ought to move that interface over toRichOp...RichOp: AnOpInstancewith metadata (OpMetadata, specifically) about how this Op functions. This metadata includes theOpHistorythis Op uses to record progress, theHintsused to match it, etc.)gselzer commentedon Sep 26, 2023
Action Items:
InfoChaintoInfoTree- it's a tree, not a list.RichOpbe merged intoOpInstance? See ReviewRichOp/OpInstance/OpMetadataAPI classes #86OpRef->OpRequestAPIHints.Historyinto theOpHistoryinterface with the nameHints.OpMatchingException->OpRetrievalException, but we decided that we like the former name better. We should also make anOpException extends RuntimeExceptionthatOpMatchingException,OpExecutionException, etc. all extend.Optional->Nullable- it's a bit of a convention among third party Java libraries, and it's also clearer about what the argument will be if the user doesn't pass it. And we don't clash with thejava.util.Optionalclass.Merge pull request #81 from scijava/scijava/scijava-ops-engine/narrow…