Comments (11)
I will try to submit a PR soon
from concerto.
I wanna work on this, can I try this if no one else is working on it @jeromesimeon
from concerto.
The issue is that the ModelManager
is created without a system model:
https://github.com/accordproject/concerto/blob/master/packages/concerto-cli/lib/commands.js#L64
In AP we use this system model:
https://github.com/accordproject/ergo/blob/master/packages/ergo-compiler/lib/apmodelmanager.js#L21
A quick fix would be to use the same system model for concerto generate
but we really should remove system models altogether to ensure that models are completely self-describing and reusable.
from concerto.
If that is the case, I should patch this first with the above suggested approach and then once the bug is fixed we can decide how to remove system model completely.
what do you guys think ?
from concerto.
@vipulbhj Sounds like a pretty good plan.
For the first step, one question will be which system model since Accord Project has one and at least Hyperledger Composer has another, and other users may have used that capability and built their own. One possibility would be to have an option --ctoSystem
which lets the user specify a system model. If we have a default system model, which should it be? I would vote for the Accord Project system model which is here: https://github.com/accordproject/models/blob/master/src/cicero/base.cto
The second step needs definitely a more complete proposal since this will affect every other project, and users. We need to decide what each kind of base type mean (Asset
, Concept
, Event
, etc). I'll be working on this, so I'm happy to join forces!
from concerto.
For reference, the way to add the system model to the model manager is illustrated here (using the Accord Project system model): https://github.com/accordproject/ergo/blob/9e216d86c87c6b67f640e7982f0e639a792e6207/packages/ergo-compiler/lib/apmodelmanager.js#L44
from concerto.
Thanks for the reference material. For the first step this does sound like a good plan. I be trying to dig more in the command code today and I will try to add the option as discussed. I am relatively new here so I am gone go with your suggestion for default, if that's okay
from concerto.
That's great @vipulbhj ! If you start a PR with some of the basic idea in place for that new option, I can review while the discussion about default model takes place.
Since cicero-cli
is brand new, we do not have to worry whether this breaks anyone's code.
from concerto.
Just a caveat: this will probably a short lived fix, since we'll likely remove the notion of system model soon after!
from concerto.
Hey @jeromesimeon, made some first rough draft changes. Mind taking a look ??
from concerto.
Fixed in #113 . Thanks for your help @vipulbhj !
from concerto.
Related Issues (20)
- LocalDateTime
- Update CTO grammar for Import Aliasing HOT 2
- Update CTO printer for Import Aliasing
- Optimizations for applying decorators on a model HOT 1
- Vocabularies don't support namespace-scoped decorators HOT 1
- Update runtime classes to understand import aliasing
- Serialization exception when declaring a default false boolean field
- Update concerto-core/serializer to understand aliased imports HOT 2
- Update concerto-core/introspector to understand aliased imports
- Update concerto-analysis rules to analyse aliased imports HOT 3
- Multiple occurence of imported type in importTypes statement
- Redefining an imported type is allowed HOT 3
- Update v4 concerto
- DCS with namespace target, don't apply decorators on top of the namespace. HOT 5
- Update docs about import aliasing usage
- Update concerto-analyser to support import aliasing
- Document / Clarify naming rules for identifiers HOT 4
- concerto-codegen supports import aliasing for Java HOT 1
- Compression for serialized objects HOT 1
- API: getActualImportTypeName() in model Flle in aliasing
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.