Archive for the ‘Remoting’ Category

h1

The principle of .NET Remoting

March 1, 2007

Remoting is mechanism for communication between two and more applications. This technology is successor of DCOM in the past but Remoting is universal, secure and more flexible. It is possible to exchange data between two prats of one application isolated in separate ApplicationDomains. In .NET every process is strarted in its own ApplicationDomain but it is possible to separate more ApplicationDomains in one process and vice versa. This organisation is used in IIS where many web applications are started in one process aspnet_wp but can be manipulated independently each other. This is because every web application has his own ApplicationDomain and it keeps it isolated from other web sites.

This technology is organised by communication via channels. There are 3 types of channels TcpChannel, HttpChannel and SoapChannel. The type of channel depends on the the network, application type … The main principle is that a specific instance of class inherits MarshalByRefObject class is created in ApplicationDomain of the application(Server) which has the specific data and this object can be accessed from the application which need the data(Client) via created channel.

In some cases it is possible replace Remoting with WebServices and this is because it is mechanism similar to WebServices but there are some big differences and in some cases Remoting is the only possible way to do something

  • Web services can be accessed only with HTTP protocol Remoting can be across any protocols
  • Web services works is stateless mod. Each time when client needs service results in new object in web service but in Remoting one object can be used by many requests from one client
  • Web services serialized objects through XML .NET Remoting relies on existing of CLR assemblies and contain information about types
  • Web services can be used from applications build on different types of technologies Remoting requires .NET