Giter Site home page Giter Site logo

Comments (9)

jeromesimeon avatar jeromesimeon commented on September 23, 2024 2

Some random thoughts:

  1. One of the benefit of using the metamodel is that indeed this allows to decouple editing from validation
  2. If we have a metamodel to ModelManager loading method, we can get rid of the AST in the model manager
  3. Using the metamodel in that way seems generally aligned with the direction of "functional Concerto" which primarily manipulates JSON objects.

from concerto.

jeromesimeon avatar jeromesimeon commented on September 23, 2024

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.

dselman avatar dselman commented on September 23, 2024

@jeromesimeon can this be closed as "implemented" now?

from concerto.

jeromesimeon avatar jeromesimeon commented on September 23, 2024

@dselman Not really yet if we stick to the letter of the issue.

Two reasons:

  1. 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.
  2. 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.

dselman avatar dselman commented on September 23, 2024

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.

jeromesimeon avatar jeromesimeon commented on September 23, 2024

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.

dselman avatar dselman commented on September 23, 2024

@jeromesimeon your recent PRs make good progress towards closing this. 👍

from concerto.

mttrbrts avatar mttrbrts commented on September 23, 2024

@dselman can this be closed now?

from concerto.

jeromesimeon avatar jeromesimeon commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.