Skip to content

Magics as interfaces #80

@andrus

Description

@andrus

This task is about improving Magics implementation. While focusing on magics refactoring, it is also about the overall implementation philosophy moving in the direction of a more transparent OO structure with fewer levels of indirection, fewer to no generic callbacks (replacing them with explicit "service" singletons) and immutability. This should result in code that is easier to understand and easier to reuse for alternative kernels.

  1. Convert @CellMagic and @LineMagic annotations into interfaces that concrete magics must implement. This makes writing and cataloging magics much simpler by removing multiple layers of indirection, making magics object-oriented and easier to understand.
  2. Make magics registry immutable, taking maps of magics in constructor. Immutability is great for comprehension as well.
  3. Make magics kernel-aware (instead of invoking kernel via generic callback functions, making tracing interdependencies extremely hard)
  4. Move extension loading logic from MavenResolver (why is it there?) to the kernel.
  5. Cleanup magic "compiler" code.

Upgrade Notes

This breaks compatibility of a few internal APIs, but should not affect notebooks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions