Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-780

MD-SAL needs to be AOT-friendly

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: Medium Medium
    • 14.0.0
    • None
    • Binding runtime
    • AOT friendliness

      MD-SAL components are designed for Java 8, when the distinction between compile-time and run-time was very much shifted to the runtime.

      With the advent of class data sharing and project Graal AOT, the reliance on run-time should be diminished: as of Java 9 we have a new link-time processing phase, which feeds into the runtime image.

      Most of the time (disregarding OSGi) we end up with a compile-time (or really link-time) bounded view of what YANG models look like.

      mdsal-binding-dom-adapter and mdsal-binding-dom-codec rely on runtime information to construct binding-to-dom view of things.

      For link-time arrangements we should generate static mdsal-binding-dom-codec classes (and perhaps mdsal-binding-dom-adapter dependecies), which feed in into AOT construction, such that the translation can be fully static and does not rely on java.lang.reflect.

      The reason for this being java.lang.reflect is inherently a run-time thing and therefore if we know the binding at link-time, we should be generate a static binding and rely on it – throwing LinkageError when we encounter something weird.

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: