Skip to content

Template: facade packages with public imports in the SysML2 examples - #74

Merged
Malcolmnixon merged 1 commit into
templatefrom
sysml2-facade-packages-template
Nov 22, 2026
Merged

Malcolmnixon merged 1 commit into
templatefrom
sysml2-facade-packages-template

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Summary

Aligns the docs/sysml2/ example files and the repository-map.md comments with the facade-package pattern in the companion standards PR (#73). This refines #64, #65, #70, and #71.

  • model/system-name.sysml: package SystemName is the facade consumers use. It now public imports its direct subsystem package (it was a private import). OTS and shared imports stay private.
  • model/system-name/subsystem-name.sysml: the subsystem package is a facade. It public imports the packages of the units it owns.
  • model/system-name/subsystem-name/unit-name.sysml: the directive says a unit private imports exactly the specific item packages it references, never a facade, because a facade re-exports the unit and the import would form a cycle. Facade part defs and mutual dependencies use qualified names.
  • views/design-views.sysml: imports the system facade only (it re-exports everything beneath it). The comment warns not to name the views package after a library package such as Views.
  • repository-map.md: marks the system and subsystem packages as facades.

Evidence

  • Spec: each file is its own root namespace and top-level names share a flat global scope (KerML 1.0 §7.2.5.3, §10.2–10.3; SysML 2.0 §7.5.5). There is no package merging (duplicates are unspecified, KerML §8.2.3.5.4). public import re-exports members (KerML §8.2.3.5.3; SysML §7.5.3). File-level imports must be private (KerML §8.3.2.4.2), so facades are packages. Cyclic imports are legal (§8.2.3.5.1) but stop the Pilot loading files one at a time.
  • Practice: OMG libraries (ISQ, SI), Sensmetry smart-home-hub, Airbus Apollo-11, and DE4SDV use one top-level package per file, private import for dependencies, and public import facades.
  • Experiments (OMG Pilot 2026-09.1 and SysML2Tools): the facade with downward public imports was the only layout where Acme::Parser and import Acme::* both resolve, with a clean strict lint. Back-imports to the facade gave Circular import detected warnings and no Pilot load order worked.

Checks

  • dotnet sysml2tools lint --strict-unresolved 'docs/sysml2/**/*.sysml' is clean, with no circular-import warnings.
  • sysml2tools render produces all three template views.
  • pwsh ./fix.ps1 and pwsh ./lint.ps1 pass.

Refines #64, #65, #70, #71. System and subsystem example packages now
public-import the packages they own (downward only); the unit and views
directives explain private imports of specific item packages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human verification is needed because the cross-file SysML namespace and facade re-export changes rely on runtime load/render and repository-specific checks that are unavailable in this snapshot.

No open issues 🎉

What changed in this PR

Updates the SysML2 template to use system and subsystem facade packages with downward public imports, enabling consumers and views to resolve nested model elements through the system facade.

Changes:

  • Makes system and subsystem packages facade packages with public re-exports.
  • Simplifies design-view imports to use the system facade.
  • Documents facade naming, import, and qualified-reference conventions.
File Description
repository-map.md Marks the system and subsystem packages as facade packages.
docs/​sysml2/​views/​design-views.sysml Uses the system facade as the single model import for views and documents naming guidance.
docs/​sysml2/​model/​system-name/​subsystem-name/​unit-name.sysml Documents specific-package imports and qualified-name conventions for unit references and cycle avoidance.
docs/​sysml2/​model/​system-name/​subsystem-name.sysml Makes the subsystem package a facade that publicly re-exports its owned packages.
docs/​sysml2/​model/​system-name.sysml Makes the system package a facade that publicly re-exports its direct subsystem packages.

Review effort: Lite

@Malcolmnixon
Malcolmnixon merged commit 94d7f2f into template Nov 22, 2026
1 check passed
@Malcolmnixon
Malcolmnixon deleted the sysml2-facade-packages-template branch November 22, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants