Custom packet - bridge for front and back communication

zhaozj2021-02-16  54

With the body and soul, the prototype of the platform is also, how is the direct communication of the front and back program?

Existing system communication methods, no extraction agreement or dependent on the middleware. Regardless of which is used, it has to organize information in accordance with certain communication formats. The difference in the agreement, the difference in format is different. With a definitely hate lengthy generated code, if the boss informs you to use FML (or XML, etc.) format, estimate that the programmer will have a long end event, and the modified test is also very troublesome. Good programmers are lazy, do not like to do a lot of tasteless work. Therefore, the platform should provide an automatic approach to automatically adapt to various formats (FML, XML, C-Struct, separator, etc.).

The original development software cannot accomplish this function, whether it is Delphi, VB, or a C language (PB has not been used, it seems to provide a similar function). With variable binding and data bus, it is also very easy to complete this feature. Before the front, it has been mentioned that as long as a name (Just One Name), you can get the required data from the bus. If we give a bunch of names together, basically constitute a message format (packet), the system obtains data according to the name, rely on the generation rules (XML, etc.) of the message format (XML, etc.), call the middleware to send reception, unpack , Display the variable on the binding control. It is basically no need for code to implement the front and rear platform interactions. The benefit is not limited to this, but when the BOSS notifies the format sent by the BOSS, only the different generation rules will be good.

(If you can program it, it is the blessing of the programmer or a disaster? I don't know, let the time verify it)

Of course, it is not as simple, special packet formats are also specially configured, such as what the name of each Node in XML is, and the length of each variable is still to be set. At least you don't have to write a lengthy code.

The platform can be implemented in the above way, and the development of the probably the front interface is only drawing pictures, and the organization is organized.

转载请注明原文地址:https://www.9cbs.com/read-18312.html

New Post(0)