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

Update API #293

Closed
mttrbrts opened this issue Jul 3, 2021 · 1 comment
Closed

Update API #293

mttrbrts opened this issue Jul 3, 2021 · 1 comment
Labels
Difficulty: Medium Type: Enhancement ✨ Improvement to process or efficiency Type: Feature Request 🛍️ New feature or request

Comments

@mttrbrts
Copy link
Member

mttrbrts commented Jul 3, 2021

Feature Request 🛍️

Today, creating new types programmatically requires string manipulation. There is an internal AST for a Concerto definition, but it is not documented nor designed for manipulation.

Use Case

With an update API, a user could add a new declaration to an existing model, or even build models completely from scratch (e.g. from a graphical tool)

Possible Solution

As well as defining a public API for model manipulation, we should define a JSON DOM (similar to Cicero Mark DOM) of a model definition to allow efficient serialisation and deserialization.

Possible API signatures

modelFile.addConcept(name, properties, [superType]);
modelFile.updateConcept(name, [properties], [superType]);
modelFile.deleteConcept(name);
classDeclaration.addProperty(name, type, optional, validators);
classDeclaration.updateProperty(name, type, optional, validators);
classDeclaration.deleteProperty(name);

Context

Changing a model definition dynamically could lead to breaking changes in client code. We could chose to reject, warn, or allow breaking changes.

Detailed Description

@dselman
Copy link
Contributor

dselman commented Dec 8, 2021

@jeromesimeon @mttrbrts now that we have moved Concerto to the published metamodel I think we can close this.

@dselman dselman closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium Type: Enhancement ✨ Improvement to process or efficiency Type: Feature Request 🛍️ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants