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

Attempt to make the generated code abstract #19

Open
jamezp opened this issue Aug 10, 2023 · 2 comments
Open

Attempt to make the generated code abstract #19

jamezp opened this issue Aug 10, 2023 · 2 comments

Comments

@jamezp
Copy link
Contributor

jamezp commented Aug 10, 2023

What I mean by this, is that it would be nice if there were some abstract types the generated source files could extend. It makes the hard-coded strings easier to read and validate via a compiler at build time instead of relying on runtime tests.

@ronsigal
Copy link
Contributor

I think that the first class I generated was ServiceGrpcImpl. The reason I generate a new class is that each method in ServiceGrpc has to be overridden. Now, certainly a lot of the code in each method could be factored out into another method, so that each overriding method would be a lot shorter. I haven't worked on that just because it's nice but not crucial.

@jamezp
Copy link
Contributor Author

jamezp commented Aug 16, 2023

That does make sense. I've not looked at the generated code enough to understand if there could be something abstract. I just thought it would be nice if we could do this. It might not be possible, which is also fine.

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

2 participants