zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2.04k stars 592 forks source link

Simplify Generation of Proxy Factory Functions #2314

Closed InsertCreativityHere closed 3 months ago

InsertCreativityHere commented 3 months ago

This PR simplifies the code-gen for the proxy factory functions (ice_twoway, ice_secure, etc.).

For the mapped proxy interfaces, we generate declarations, not implementations. This was so repetitive, I rolled it into a much simpler for-loop.

For the mapped proxy classes, we no longer generate the implementations at all. Instead, I added an intermediate class which implements everything instead.

Previously, the inheritance was: _FooPrxI extends _ObectPrxI implements FooPrx Now, it is: _FooPrxI extends _ObjectPrxIWrapper<FooPrx> implements FooPrx And ObjectPrxIWrapper extends _ObjectPrxI, so this change should be backwards compatible.


An alternative approach is to delete this wrapper class, and just generate the implementations directly on the proxy classes themselves. If you'd find that preferable to adding this intermediary class, feel free to voice your opinion.

InsertCreativityHere commented 3 months ago

I added a test case in https://github.com/zeroc-ice/ice/pull/2314/commits/98fc270e2c425e314547f35f8b8fc7ef8036b05d