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

Use Protobuf message replace Object and implement all hessian type #10

Open
zyfjeff opened this issue Feb 8, 2021 · 2 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zyfjeff
Copy link
Collaborator

zyfjeff commented Feb 8, 2021

C++ does not have a global parent like Java Object, so there is no single type that can represent all hessian types, so we create an Object base class from which all hessian types are inherited. However, this Object is still not easy to use, complex to construct, and does not provide a complete API similar to that of a standard container. If we use Protobuf to define all Hessian types and use the ProtoBuf Message Object as our base Object class, we can reuse the entire Protobuf API that we provide, thus improving the overall usability.

@zyfjeff zyfjeff added enhancement New feature or request help wanted Extra attention is needed labels Feb 8, 2021
@Lynskylate
Copy link
Collaborator

Lynskylate commented Feb 9, 2021

There may be some problems when using the pb type directly. For example, the key of struct type fields only accepts string.It’s hard to avoid defining a HessianStruct.

message TypeStrcut {
  string type_name = 1;
  map <Value, Value> fields;
}

Maybe it’s a good idea to use the type we defined as an intermediate type, for users to use code generated from proto idl or jar package

Dubbo can generate js code from dubbo jar.

@zyfjeff
Copy link
Collaborator Author

zyfjeff commented Feb 9, 2021

@Lynskylate We do need to use protobuf IDL to define some complex Hessian types, such as Class, Map, List, etc. The primitive types provided by Protobuf do not meet the requirements.

@zyfjeff zyfjeff pinned this issue Feb 9, 2021
@wbpcode wbpcode unpinned this issue Dec 27, 2021
@wbpcode wbpcode pinned this issue Dec 27, 2021
@wbpcode wbpcode unpinned this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants