-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Inclusion inheritance for element children #638
Comments
Hey @jubr, Thank you for your interest in the project and for sharing your thoughts. I had a similar concept in mind - a "logical-only" element that exists in the model but is not displayed on diagrams, smth like a boundary/domain/zone. But later, I realized that presenting these elements on higher levels could be also beneficial. Your idea takes it a step further by proposing the automatic inclusion of nested elements. However, I believe this should be more closely tied to the view/predicate rather than being globally defined by the specification (specs modifications impact a lot and lead to unexpected results and diagram changes). Here are my pennies Predicate expressions sugarCome up with a beautiful shortcut for: include sys.ga, sys.ga.* I'm open to suggestions. Expand ruleSomething like: expand sys.ga
expand element.type=group Implicitly adds Any thoughts on this? Have you seen this discussion #533? PS Wow, thank you so much for the hint with 🤘 |
Tag-based inclusion with I can understand that spec changes can have far-reaching consequences, but if one adheres to the Open-Closed Principle by providing new opt-in functionality this should not be a problem. Existing behavior can always be safeguarded with proper Since posting the feature request I'm now leaning towards breaking this up into 2 features, that together can provide the "group" behavior:
This also means it can be worked on, delivered and applied to elements separately. specification {
element system { }
element container { }
element group {
//expand none // is the default, same as not specifying it
//expand all // these elements are auto-expanded (child elements included together with their parents)
expand withRelationships // child elements included, but only if they have in- or outgoing relationships to currently visible elements
}
}
model {
system sys {
group ga {
//expand withRelationships // can also specify here, but DRY at spec level
//expand none // possibly negate all/withRelationships at spec level
container c1 { }
}
}
}
views {
view of sys {
include *
//expand sys.ga withRelationships // addressing by FQN
//expand element.type=group all // addressing by element type
//expand element.tag=#abc none // addressing by tag
}
} What do you think, are we getting somewhere? 😛 |
Hey @jubr My apologies for the delayed response; time seems to have slipped away. I have introduced expand predicate in v1.0.0, and results are much more prominent. I am pretty optimistic that this new predicate may be the most useful one. I'm eager to hear your thoughts. |
Hi @davydkov, fist of all: thanks for creating the versatile LikeC4 while keeping the number of keywords in the language to a minimum! ❤️
I'm working on a large model for a project & I find myself having introduced a
group
element that I use exclusively for - drumroll… - grouping within asoftwaresystem
. Take this minimal example with the problem description added inline:The extra include/exclude code I need to add in all the views is really adding up :'(
I think what could really help in this case was if it would be possible to cause the automatic inclusion of direct children of an element. Perhaps with a new keyword along the lines of:
Which would cause its direct children to also be included if this
group
element is included in a view.Or perhaps this should even be encoded in the
shape
, since it it does not behave like a regular element:What do you think?
PS. In absence of GitHub markdown recognizing LikeC4, I find using
```zig
code blocks to do at least something for readability 😀The text was updated successfully, but these errors were encountered: