-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hello,
I find that using strings to reference elements prevents us from taking advantage of the features offered by our IDEs (like static analysis, re-factoring, etc.). However, defining variables brings a lot of scopes challenges.
The following does not work:
var _ = Design(func() {
SoftwareSystem("mysystem1", func() {
container1 := Container("mycontainer1", func() {
})
})
SoftwareSystem("mysystem2", func() {
Container("mycontainer2", func() {
Uses(container1, "Uses")
})
})
})
We have to pre-declare variables like the following:
var _ = Design(func() {
var container1 *expr.Container
SoftwareSystem("mysystem1", func() {
container1 = Container("mycontainer1", func() {
})
})
SoftwareSystem("mysystem2", func() {
Container("mycontainer2", func() {
Uses(container1, "Uses")
})
})
})
I would like to be able to write something like the following instead:
var _ = Design(func() {
system1 := SoftwareSystem("mysystem1", func() {
})
container1 := system1.AddContainer(Container("mycontainer1", func() {
}))
SoftwareSystem("mysystem2", func() {
Container("mycontainer2", func() {
Uses(container1, "Uses")
})
})
})
Metadata
Metadata
Assignees
Labels
No labels