Remoting & Version

xiaoxiao2021-03-06  136

1. The client version is higher than the server side

1.1 Vo (Value Object Change)

Previous version (server side):

New version (local port):

Test Content 1: Whether the previous Value Object method can be used.

The result is normal to obtain the result.

Test Content 2: Whether a new Value Object can be used.

The result is returned NULL, but no exception will be thrown.

1.2 Add a method

Previous version:

New version:

Test content 1: Whether the previous remote method can be used. No abnormal throws successfully applied for a single single of ECTEST.

Test Content 2: Whether the newly added remote method can be used. Endlessly throw an abnormality as expected.

2, the server is higher than the client version

New version: (server side)

Older version (client):

Obviously this situation is not possible to use the newly added function (because it is impossible to compile -_- ||)

2, 1 New Vo (Value Object) After adding a method, call the previous method to return Vo as a result, and call its previous data.

The result fails and throws an exception.

2, 2 server-side adds a new method (no practical features, just for testing) and the client uses a lower version to call for some operations.

The result is normal and successfully completed all the operations.

3, conclusions and preliminary analysis

The above test is no doubt is a very rough process. In fact, this test itself is based on such a hypothesis: the new version recognizes all the methods provided in previous versions, his modification is just changing the implementation, and add new features. But I believe this hypothesis is a reasonable reason, because it is clear that if the new version itself does not support a certain method, then it will inevitably lead to failure based on older version of the client program. If we want the overall IT system to do SOA, then violates the above hypothetical changes should never happen.

But if we carefully analyze the above test, it will find some quite interesting issues. Both objects of the .NET Remoting Framework: MBV and MBR have a complete different behavior pattern for modification.

From the viewpoint (with the abnormal standard), for MBV, he can tolerate the new client program to run in the old service (see 1, 1 test), if the client program is based on the older The version is developed, then there will be no problem. However, this feature also brings a hidden trap. If the client is based on newer version development, then the unmatched service provider does not report any exception, which may make the problem in a very strange way Reflect (or even -_- || in another third party system).

For MBR, the situation is normal. He allows the older client to run in a new service, and if there is no newly added function, then the situation is also allowed. In general, it is not a problem as long as the server is described and the client is the same.

If we are studying, it should be said to be closely related to the work of these two objects. For MBV calls, the agent will complete the object copy via formatter. For MBR objects, the agent performs all things by reflection.

From this we can know the modification of the MBV object, will be a very significant version change because it will cause all the old system work failure (assuming that the old system is not updated in time). On the contrary, there is no such earthwork for the modification of the MBR object, as long as the version of the server is high enough, then there will be no problem. Although from the versatile perspective, the MBV object is in a fairly unfavorable situation. However, based on performance, MBV is still a choice with considerable temptation. In addition to the first creation, this object can provide and local objects without any distinct performance.

From a contrast point of view, the issue of using the Remoting technology is quite slight. After all, the update of the previous COM, Com is a very simple thing, as long as a new file is placed there. If you use some simple profile, guide the Loader of the .NET platform, even update, you can do transparency. Compared with Web Service, the MBR object also provides identical capabilities. If most people are using the Web Service when using the Web Service, all IDE automatically generated Class and include in the main program set, then transing may easily update some.

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

New Post(0)