Skip to content
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

Add DSL Code Generation #537

Closed
wants to merge 7 commits into from
Closed

Add DSL Code Generation #537

wants to merge 7 commits into from

Conversation

raphael
Copy link
Member

@raphael raphael commented Oct 14, 2023

This PR adds the ability for model to generate the Go DSL for a given JSON representation of a model.
This makes it possible to roundtrip JSON code generation from and to the DSL.
UIs can take advantage of this functionality to allow for changes made either in the DSL or directly to the JSON.

Components can be used to represent endpoints:

```go
		Container("Web Application", "Delivers content to users.", func() {
			Component("Dashboard Endpoint", "Serve dashboard content.", func() {
				Tag("endpoint")
			})
			Uses("Application Database", "Reads from and writes to", "MySQL", Synchronous)
		})
```
`Uses` can target the endpoint alleviating the need for `Calls`:
```go
		Container("Load Balancer", "Distributes requests across the Web Application instances.", func() {
			Uses("Web Application/Dashboard Endpoint", "Routes requests to", "HTTPS", Synchronous)
		})
```
Reverse engineering the DSL from the JSON isn't practical...
@raphael
Copy link
Member Author

raphael commented Oct 14, 2023

Closing this PR as the approach consisting of reverse engineering the JSON into DSL has too many limitations.

@raphael raphael closed this Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant