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

Recursive binding of interfaces, custom method naming rules #130

Open
hovi opened this issue Feb 10, 2022 · 1 comment
Open

Recursive binding of interfaces, custom method naming rules #130

hovi opened this issue Feb 10, 2022 · 1 comment

Comments

@hovi
Copy link

hovi commented Feb 10, 2022

We've been using your library for a while for our Space Engineers plugin:
https://github.com/iv4xr-project/iv4xr-se-plugin

We are trying to keep very clean and tree-structured interface, most of it can be seen here:
https://github.com/iv4xr-project/iv4xr-se-plugin/blob/main/Source/Ivxr.SpaceEngineers/ISpaceEngineers.cs

We want to keep method naming in this dotted fashion. Ex call Blocks.Build and that is our method naming convention.
We've been using your JsonRpcMethod annotation and had mapping class for it:
https://github.com/iv4xr-project/iv4xr-se-plugin/blob/main/Source/Ivxr.SePlugin/Communication/AustinJsonRpcSpaceEngineers.cs

This was fine for a while, but this class is basically only boilercode to do the mapping. We are adding a lot more methods and this is getting annoying and feels unnecessary. We have very clear and simple interface, that already says everything and mapping could be generated straight ouf of it, no need to mark anything (all methods are supposed to be exposed).

Would be cool if there was a mechanism to do that - just bind interface, pass implementation and let the library bind everything, which is part of the interface (that way it also doesn't mess with GetType, Equals, ToString and other generated methods).

I created our own way, based on your ServiceBinder as a working proof. In case you are interested in putting some parts of it into your library too, I am happy to assist.
iv4xr-project/iv4xr-se-plugin#127

@Astn
Copy link
Owner

Astn commented Jun 8, 2022

Very cool! I'm sure others would enjoy this flexibility as well.

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