Giter Site home page Giter Site logo

Comments (2)

MGlauer avatar MGlauer commented on July 30, 2024 1

I agree, that there are two ways forward here:

  1. Keep the internal representation (structure.py) and create a second that reflects the newer version and implement translations between those representations.
  2. Update structure.py, but update parsers and compilers to translate older versions into the newer structure.

I think I would prefer the first one, given our use-cases. The intention of OMI is that users can use the present python structures in their code to define metadata objects. If these structures change, it may break the code of these users. But I do not have any definite opinions on this.

from omi.

jh-RLI avatar jh-RLI commented on July 30, 2024

@MGlauer
I have started to implement this towards the approach described in 1. In the process more questions came up:
(have not yet pushed anything)

  • If I see this correctly, after splitting the structure [1] into one module per oemetadata version, it is also necessary to create an explicit class for all compilers. So for example under src/omi/dialects/oep/compyler.py you have to create one class for the JSONCompiler [2] per oemetadata version. The same goes for the parser, also here you have to create one parser class per oemetada version. (Or is there a better approach to implement this?).
  • Which structure should be used in the base dialect then?

[1]
image

[2]
old

class JSONCompiler(Compiler):
    __METADATA_VERSION = "OEP-1.4.0"
.....

new

class JSONCompilerOEMv1_4_0(Compiler):
    __METADATA_VERSION = "OEP-1.4.0"
    ....

class JSONCompilerOEMv1_4_1(Compiler):
    __METADATA_VERSION = "OEP-1.4.1"
    .....

class JSONCompilerOEMv1_5_0(Compiler):
    __METADATA_VERSION = "OEP-1.5.0"
    .....

class JSONCompilerOEMv1_5_1(Compiler):
    __METADATA_VERSION = "OEP-1.5.1"
   .....

from omi.

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.