Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds changes for sequence data type #144
Adds changes for sequence data type #144
Changes from 1 commit
d716c37
3bda35b
2a2cdd7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to have to create corresponding
Wrapped*
variants for all of the non-wrapped variants? Why/why not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I think its in general there are only 3 types structure, sequence and scalar. Where only nested structure would have a name but scalar and sequence would not have name. Hence to separate out whether they are named or not I have them as a separate variant. I think having them separate allows us to perform specific operations for these types which will be stored as property instead of entirely different class in the generated code.
e.g. For below ISL:
Here's the generated code in Java:
whereas for structure type like following:
Here's the generated code in Java, which creates a new nested type for this nested structure:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need the non-wrapped variant of sequence? We have parameterized, fully-qualified type references, so we should be able to model the non-wrapped lists as e.g.
java.util.List<org.example.MyGeneratedClass>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WrpapedSequence
useFullyQualifiedTypeName
(notFullyqualifiedTypeReference
). AndWrappedSequence
have a name, for example:Above wrapped sequence's name will be stored as
org.example.Foo
.Whereas
Sequence
would not have a name, for example:We can surely store it as fully-qualified type references and thats what we already we store the
element
property asFullyWualfiiedTypeReference
and then when storing this type intoTypeStore
we usejava.util.ArrayList<String>
but it still wouldn't have name (like the wrapped sequence has name asfoo
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but the non-wrapped version (
Sequence
) does not have a name and does not have a class generated for it. Therefore, why do we need to have the unnamedSequence
model? You don't need a reference to theSequence
when you can just use a parameterized reference such asjava.util.ArrayList<java.lang.String>
.For example, if you have this schema, the
{ type: list, element: string }
does not need aSequence
to be created to represent it. Instead, the fieldbar
should have the data model equivalent of a reference tojava.util.ArrayList<java.lang.String>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created an issue for this: #145. Need to look at if removing the non-wrapped variants has any requirements for how they are rendered in templates.