Microsoft's. NET Remoting provides a framework that allows an object to interact with another object through an application domain. This article will introduce its features through two specific code examples. Through. NET Remoting, the communication between the two applications will become very simple and flexible.
In the computer world over the past few years, there have been constant discussions on scale-out and scale-up, there is also a tendency to convert to scale-out. In the past, when computers couldn't keep up with the performance requirements of applications, people would buy a better and more expensive machine, which is scale-up, scale-out solves this problem by adding more machines to the network, so that the entire system does not need to be replaced. By assigning the computing burden to multiple systems, the entire system has higher availability.
If we push this scale-out idea further, we may find that: why should we put the processing like credit card verification and shipping tracking in our system? Can it be easier to call the seller's applications to directly obtain these services? If we can do this, we can extend the functions of our programs without adding additional hardware. It is worth noting that this will change the role of another ISV (independent software developer) from a software provider to a service provider.
This idea is good, but there are a lot of problems in the current technology to implement it. DCOM has problems when working across firewalls. DCOM is built on private Protocols, while CORBA has different interfaces. It would be even more difficult to put DCOM and CORBA together.
To achieve this scale-out idea, we need a component technology that can work seamlessly across multiple types of networks and protocols. Remote. NET can achieve this.
This seamless interaction is achieved through the use of XML and SOAP. However, it does not identify SOAP as the only method for component interaction, nor does it identify HTTP or TCP/IP as the network protocol used to connect to these services. This makes the remote architecture more flexible and can adapt to protocol and network changes.
The. NET architecture uses channel objects to connect applications .. The NET architecture proposes two channels:
System. Runtime. Remoting. Channels. TCP
System. Runtime. Remoting. Channels. HTTP
The TCP channel is very similar to the existing DCOM and can provide high performance. when the machine is in an internal network, the TCP channel can be used, while the HTTP channel uses the HTTP protocol, allows applications to interact on the Internet. Because it uses the HTTP protocol, it can easily achieve load balancing and use the firewall.