Skip to content
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

Improve mapping from proto type to Java class #511

Open
alexander-yevsyukov opened this issue Feb 20, 2020 · 0 comments
Open

Improve mapping from proto type to Java class #511

alexander-yevsyukov opened this issue Feb 20, 2020 · 0 comments

Comments

@alexander-yevsyukov
Copy link
Contributor

alexander-yevsyukov commented Feb 20, 2020

The task of mapping a proto type to Java class was initially based on .properties files, which mapped a proto type name to a Java class name.

Then, we improved the generation, migrating to using descriptor set files, and building KnownTypes basing on them. It works better on the code generation side, but in order to unpack just one message from Any we need to load and build a very big thing.

We can probably do better, generating a Java class file which would have ImmutableMap from one string with a proto type name to another string to a Java class name. The name of the class would be a constant, which KnownTypes would use to load the class, and use its mapping for loading the classes.

There are may be other, better options. This issue was raised in the discussion of our Protobuf article for DOU (см. секцию «Собрание типов»).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant