Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 10 Guidelines for Programming : Avoid Sending Binary Data Buffers or Internal Structs

Avoid Sending Binary Data Buffers or Internal Structs
Rendezvous programs can exchange binary data buffers using datatype TIBRVMSG_OPAQUE. The program is free to use any format and content within opaque data. However, it is good practice to avoid extensive use of opaque data.
For example, opaque buffers can contain data structures mapped by C language structs—but beware, this technique couples your programs rather tightly to the data structure. If you change the struct definition in the sender, you must also change it in the listener, and vice versa. Exchanging structs also makes it more difficult to introduce new, interoperating programs in the future. Furthermore, exchanging internal structs makes it difficult to for your program to interoperate with programs developed in other languages.
Binary data and internal structs are also platform dependent—you cannot exchange raw, binary data between programs running on machines that represent numbers or character strings with different formats.
Instead of binary buffers or structs, consider using Rendezvous self-describing data to ease data exchange. Rendezvous datatypes span the most common atomic and array datatypes of most programming languages, and Rendezvous messages can emulate any struct or composite datatype.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved