concerto
concerto copied to clipboard
java.time.Instant rather than java.util.Date in the Java target format?
Is it recommended best practice to use Java.time rather than the older (and considered poorly designed) Java.util.date, as currently used by the concerto-tools
Java target.
Context
This isn't a bug, but a suggestion for improvement.
Expected Behavior
CTO concepts making use of the DateTime
atomic types should generate Java classes with fields using java.time.Instant
.
Actual Behavior
CTO concepts making use of the DateTime
atomic types generate Java classes with fields using java.util.Date
.
Possible Fix
Maybe, just this line to change:https://github.com/accordproject/concerto/blob/58a322bf0541c2b5ccd68b60da674efe9f6a9a36/packages/concerto-tools/lib/codegen/fromcto/java/javavisitor.js#L364
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs in the next 14 days. Thank you for your contributions.
This issue has been automatically closed because no further activity occurred. If you believe the issue is still relevant, please either reopen this issue, open a new issue, or contact one of the project maintainers
bump!
I can do it for you
Sorry I missed this @kishiiv That would be great if you are still up for it!
I would love to get feedback from @dselman or @mttrbrts on this.
In the meantime I'm assigning it to you.
Technical note on this: We probably want to make sure that whatever type we pick plays well with Jackson https://github.com/FasterXML/jackson
We want to make sure that concerto object in JSON format containing DateTime will be loaded as proper JSON objects of class java.time.Instant
if we make the switch. This should be tested somehow.
i want to work on this
May I work on this?
hey @jeromesimeon @mttrbrts can you review my pr once?