Skip to content

Finalize naming of ops-related core classes #81

Closed
scijava/incubator
#90

Description

@ctrueden

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"?

Activity

  1. ctrueden commented on Dec 6, 2021

    @ctrueden
    MemberAuthor

    InfoChain is a resolved op. ResolvedOp or MatchedOp could be good names, if we are keeping Op as a suffix for classes like this.

  2. ctrueden commented on Dec 6, 2021

    @ctrueden
    MemberAuthor

    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.

  3. ctrueden commented on Dec 6, 2021

    @ctrueden
    MemberAuthor

    As mentioned in this comment: we could consider combining RichOp and AbstractRichOp into a single abstract base class. Who needs interfaces? 😜

  4. gselzer commented on Jan 14, 2022

    @gselzer
    Member

    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 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.)

  5. gselzer commented on Sep 26, 2023

    @gselzer
    Member

    Action Items:

    • Change InfoChain to InfoTree - it's a tree, not a list.
    • Can RichOp be merged into OpInstance? See Review RichOp / OpInstance / OpMetadata API classes #86
    • OpRef -> OpRequest
    • Once Minimize and proof SciJava Ops API & SPI incubator#90 is merged (or as part of that PR), move APIHints.History into the OpHistory interface with the name Hints.
    • 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.
  6. linked a pull request that will close this issueMinimize and proof SciJava Ops API & SPI #90on Oct 5, 2023
  7. added a commit that references this issue on May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions