Open thomaspeugeot opened 1 year ago
For the commit on a stage to be performed on all stages that are dependant of the stage, one need to apply the Depth First Search algorithm.
func DFS(node *Node, visited map[*Node]bool, fn func(*Node)) {
if node == nil || visited[node] {
return
}
visited[node] = true
// Apply the given function to the current node
fn(node)
// Visit neighbors
for _, neighbor := range node.Neighbors {
DFS(neighbor, visited, fn)
}
}
This is a recapitulative of the task of supporting multiple package.
Rationale
The rationale for this issue is to overcome a limitation of gong, namely, only the "models" package is compiled by gongc. Any subpackage is ignored. Therefore, more complex models cannot be compiled. For models like 15288 modelling or SySML, multiple packages are needed for complexity management (and for name collision avoidance).
Scope
It is understood that multipackage model won't need
To be abandonned (unless it is easy after all the rest has been done)
Remaining are:
Architecture
The manual example developed in
test2
shows that the generated code could be very similar from one package to the other (except for thepackage models
that becomespackage x
orpackage orm
that becomespackage x
and the imports that need to be aliasedcontollers_x, orm_x, ...
Steps
De Weck Architecture Tool, with a concrete syntax would be ideal. But a model with a package "user" and another "product" seems more helpfull for a start
modifs goes the same depencecy way
Front:
Supporting hierarchy is key for complexity mngt. (for mimicking jointjs hierarchy for instance)
going from one stack is one package to one stack is many packages
There is per stack:
For marshalling, there is a need to convert the package path into a unique identifier
what package alias can be automaticaly devised ?
Here's the updated implementation that uses the last three parts of the import path to generate unique aliases:
For go:
For ng:
still on front repo