Repository navigation
Template: facade packages with public imports in the SysML2 examples - #74
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the
docs/sysml2/example files and therepository-map.mdcomments with the facade-package pattern in the companion standards PR (#73). This refines #64, #65, #70, and #71.model/system-name.sysml: packageSystemNameis the facade consumers use. It nowpublic imports its direct subsystem package (it was aprivate import). OTS and shared imports stay private.model/system-name/subsystem-name.sysml: the subsystem package is a facade. Itpublic imports the packages of the units it owns.model/system-name/subsystem-name/unit-name.sysml: the directive says a unitprivate 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 asViews.repository-map.md: marks the system and subsystem packages as facades.Evidence
public importre-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.ISQ,SI), Sensmetry smart-home-hub, Airbus Apollo-11, and DE4SDV use one top-level package per file,private importfor dependencies, andpublic importfacades.Acme::Parserandimport Acme::*both resolve, with a clean strict lint. Back-imports to the facade gaveCircular import detectedwarnings and no Pilot load order worked.Checks
dotnet sysml2tools lint --strict-unresolved 'docs/sysml2/**/*.sysml'is clean, with no circular-import warnings.sysml2tools renderproduces all three template views.pwsh ./fix.ps1andpwsh ./lint.ps1pass.