#RPC (Remote Procedure Call) usually does not use basic data types directly, but uses composite data types such as structures and objects for several reasons:
Data encapsulation and decoupling: Using composite data types can better encapsulate data and reduce the coupling between modules. This will help better organize the data and improve the maintainability and scalability of the code.
Cross-language compatibility: In the case of cross-language, different programming languages may have different storage and representation methods of basic data types. Using composite data types makes it easier to achieve cross-language compatibility.
Rich data expression capabilities: Composite data types can express various data structures more flexibly, such as arrays, dictionaries, custom objects, etc., thus satisfying data in more scenarios transmission requirements.
Better type safety: By using composite data types, type safety during data transmission can be better ensured and errors caused by type mismatches can be reduced.
In general, using composite data types instead of directly using basic data types can improve the maintainability and scalability of the code, and is also more suitable for cross-language scenarios. Provides a more flexible and secure data transmission method.