Skip to content

Support references before definitions in DSL #328

@mattdrees

Description

@mattdrees

Description

It looks like the parser does a single pass through the DSL file, and validates references as it goes.

So, this is valid:

workspace {
  model {
        a = softwareSystem "A"
        b = softwareSystem "B"
        a -> b
  }
}

but this is not:

workspace {
  model {
        a = softwareSystem "A"
        a -> b
        b = softwareSystem "B"
  }
}

This is the error message from structurizr-cli validate:

The destination element "b" does not exist at line 4 of /myprojects/structurizr-java/structurizr-dsl/src/test/resources/dsl/relationship-ref-before-target.dsl: a -> b

Not the end of the world, but I've several times wished I could define a relationship in or around a source system (system "A"), rather than having to define it way down in the file after the target system (system "B").

Does that sound like something you'd be interested in supporting?

Priority

I have no budget and there's no rush, please add this feature for free

More information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions