Comments (9)
Some random thoughts:
- One of the benefit of using the metamodel is that indeed this allows to decouple editing from validation
- If we have a metamodel to ModelManager loading method, we can get rid of the AST in the model manager
- Using the metamodel in that way seems generally aligned with the direction of "functional Concerto" which primarily manipulates JSON objects.
from concerto.
A strategy toward this goal could possibly make use of the new metamodel (i.e., use updates on the metamodel, generate CTO or model manager from them).
from concerto.
@jeromesimeon can this be closed as "implemented" now?
from concerto.
@dselman Not really yet if we stick to the letter of the issue.
Two reasons:
- For model managers obtained from cto files: Currently you can take an individual model file and get the metamodel instance for it. You can also generate a .cto file from that metamodel instance. What you cannot do yet is generate a set of .cto file from all the ModelFiles in the MetaModel.
- For model managers obtained programmatically (not sure if anyone actually uses that). You cannot get the metamodel at all, since the metamodel generation uses the parser AST at the moment. So it only works if you have parsed a cto file in the first place. I think this would need to be addressed for the update scenario.
from concerto.
I think I get it.
For (1) this doesn't sound like too much work, is it? Loop over a set of meta models and convert each to a CTO file with the correct name in a directory (or in memory) using FileWriter
. I can take a stab at that, if useful.
For (2), we probably need a discussion and a design. In particular how we deal with referential integrity errors that are introduced during editing. My gut feeling is that perhaps we start by supporting people editing the meta model JSON and then internally convert it to CTOs (first level of validation) followed by parsing the CTOs and bringing it back into memory as a new ModelManager
(second level of validation, to check references are valid). It's a bit convoluted and inefficient but probably less invasive on the existing code. Happy to brainstorm and talk that over in person!
from concerto.
I think I get it.
For (1) this doesn't sound like too much work, is it? Loop over a set of meta models and convert each to a CTO file with the correct name in a directory (or in memory) using
FileWriter
. I can take a stab at that, if useful.
yes that's trivial, except maybe for the file generation. would be best to create a ./output
directory as we do for other generations maybe.
For (2), we probably need a discussion and a design. In particular how we deal with referential integrity errors that are introduced during editing. My gut feeling is that perhaps we start by supporting people editing the meta model JSON and then internally convert it to CTOs (first level of validation) followed by parsing the CTOs and bringing it back into memory as a new
ModelManager
(second level of validation, to check references are valid). It's a bit convoluted and inefficient but probably less invasive on the existing code. Happy to brainstorm and talk that over in person!
agreeing completely. I think the bigger / harder question is what is the update API and what does it operate over (e.g., directly on model manager with CTO generation? or directly on metamodel instance with model manager generation?). Maybe I like the latter as you suggest, but I haven't spent much time thinking about this yet and it needs some design / review.
from concerto.
@jeromesimeon your recent PRs make good progress towards closing this. 👍
from concerto.
@dselman can this be closed now?
from concerto.
@dselman can this be closed now?
I think all the foundations for doing this are in place. It would have to be double checked and also maybe some proper API for this should be discussed, which would allow to facilitate that use case, and document how to do it.
from concerto.
Related Issues (20)
- Improve error reporting when decorator manager applies a duplicate decorator
- Add support for adding multiple decorators in the same command for a property
- Add normalizeIdentifier method in C# lib
- Concerto analysis changes HOT 2
- Provide an API to extend the default rules of the analyser
- Inconsistent ast types in introspect HOT 2
- Issue trying to validate declarations without properties
- Support Decorator Command Set validation independent of applying decorators
- Support max length for array and map
- "Install the Command Line Tool" link is broken in readme
- Vocabulary support for Map Types in Concerto HOT 3
- JSON Schema output is not working for Scalar Arrays
- Concerto CLI parser allows multiple application of the same Decorator, but not ModelManager HOT 1
- Should not be able to create a concept whose super type is itself
- Decorator Command with properties without a type adds decorator to declaration
- feat: Extract the vocabulary set and decorator command set from a model manager
- Remove Functional API
- VocabularyManager: support configurable fallback locales
- Migrate to ESM from CommonJS Modules HOT 1
- Map does not support polymorphic values HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concerto.