Skip to content

2.0: generate a library from a standard base plus extension overlays #81

Description

@ctgnz

Placeholder for the 2.0.0 architectural change. Likely to become an epic - this records the decisions and
evidence so far rather than a finished design.

The split that drives it

Two concerns have been conflated:

  • Model authoring is usefully thought of as a standard model plus extensions producing a superset.
  • Consumption is not. A client application sees exactly one library, containing whatever model it was
    generated from, and must have exactly one generated library on its classpath. Two would mean two
    IconLibrary implementations and an ambiguous discovery (Discover the IconLibrary implementation from the classpath instead of naming it #76).

So composition belongs at generation time, and the output stays a single artifact. That rules out the
otherwise-obvious idea of hallux depending on jmsfx-standard and contributing only its additions -
that produces two libraries on the classpath, which is the case #76 has to fail on.

Why it is now feasible

Both preconditions are established and verified:

model-hallux.yml is therefore a 3,724-element file of which 3,423 elements are a verbatim copy. An
extension overlay would carry only the 301 additions.

Questions to settle

  • Overlay format: additions only, or a delta that can also amend? Additions-only is the stronger
    invariant and matches what hallux actually does today - and CTG has confirmed additive-only is a
    deliberate rule, not an accident of how it turned out.
  • Enforcement: a model comparison in the spirit of FragmentComparator, failing the build if an
    overlay ever removes, renames or alters a base element. The comparison already exists as a script and
    would become a proper tool.
  • Fragment packaging: the generated library needs every fragment it can draw, including the 2,973 it
    shares with the base. Either they are duplicated into each library's jar at build time, or a
    resources-only artifact carries them. The latter must not implement IconLibrary, or it reintroduces
    the two-libraries problem. Note 2.0: inject SVG fragments into the generated classes instead of resolving file paths #82 may make this moot, by removing fragment files from the equation.
  • Repo layout: whether the overlay lives in the hallux repo (as model-hallux.yml does now) or beside
    the base model.

Related

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions