metarhia / jstp

Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
https://metarhia.github.io/jstp
Other
143 stars 10 forks source link

Use inheritance instead of composition in server adapters #192

Closed belochub closed 7 years ago

belochub commented 7 years ago

At the moment all of our Server adapters (which are passed to its constructor as rawServer argument) are using composition to store the original server object, which is being created in the same place using methods similar to those original server object has. It results in a lot of boilerplate code and usage of workarounds which can be avoided by inheriting the adapters from the classes used in an underlying implementation now.

This will obviate PRs like https://github.com/metarhia/jstp/pull/190 and should we decide to go with the proposed approach, it will make sense to close the PR.

@metarhia/jstp-core, what is your opinion on the topic?