Remoting series (1) -- Basic concepts of remoting

Source: Internet
Author: User
Tags http authentication
Http://www.cnblogs.com/Ring1981/archive/2006/07/20/451624.html
Remoting series (1)-basic concepts of remoting Remoting technology Overview

One remotingTechnical Background

1) Rapid growth of Distributed Application Requirements(Peer-to-peer, gridAnd other technologies)
2) original C/S, B/SModels and technologies are no longer competent(Serial PortRS232, socket, RPC, DCOMTechnical disadvantages)


What isRomoting?

A technology that uses distributed programming,Remoting is mainly used to manage cross-applicationProgramSynchronous and asynchronous RPC sessions for domains. By default, remoting uses HTTP or TCP protocol and uses XML-encoded soap or native binary message format for communication .. Net remoting provides a flexible and scalable programming framework that can manage the status of objects.

Advantages of remoting:
1) Performance: If the. NET remoting performance is optimized, its performance is very good and its speed is close to that of DCOM.
2) Scalability:. Net remoting allows you to select transmission channel types (such as HTTP and TCP) and format types (such as binary and SOAP ).
3) configurable: You can configure the application through the configuration file.
4) Advantages of Clr and CTS. net remoting is based on. net Framework, so it has the easy-to-use and powerful features of Common Type System (CTS) and Common Language Runtime (CLR.
5) Interoperability:. Net remoting supports development standards (HTTP, SOAP, WSDL, XML ).
6) Security
7) lifecycle management


III remoting architecture:

Remoting transmits messages through channels .. Net remoting supports two default protocols: HTTP and TCP ).


4. Two meanings of remote objects

Remote Object operation:The object runs remotely.,The client sends messages to him..
Passing remote objects:Get the remote object to the local,Or, you can send the local object toCopy operation.


5. Two Methods for activating an object:
Server activation and client Activation

1. server activation:"Server-activated objects" are objects that are controlled by the server for a lifetime. They are created by the server as needed only when the client calls the first method of the object. Server-activated objects only support Default constructors.
Code:

< Service >
< Wellknown Mode = "Singlecall" Type = "Hello. helloservice, hello"  
Objecturi = "Helloservice. Soap"   />
</ Service >

The wellknown type of a server is described above, and its activation mode is setSinglecall.

There are two activation modes for server-activated objects:SingletonAndSinglecall.
1) Singleton (Single Instance ):
These objects follow the traditional Singleton design mode. In this mode, there is only one instance in the memory, and all clients accept the services provided by the instance.
Features:
A. The server segment is instantiated only once, and the same instance will be accessed each time you call it.
B. It can be maintained.

2) singlecall (monotonous)
SinglecallThe remote server type always sets an instance for each client request. The next method call will be performed by another instance. From the design perspective,SinglecallType provides very simple functions. This kind of mechanism does not provide status management. If you need status management, this will be a disadvantage; if you do not need it, this kind of mechanism will be ideal. Maybe you only care about load balancing and scalability, but not the status. In this case, this mode will be your ideal choice, because there is only one instance for each request. If you want to, developers canSinglecallThe object provides its own State management, but this state data does not reside in the object, because each time a new method is called, a new object identifier will be instantiated.
Features:
A. New instances are added to each call.
B. Better support for stateless programming models

2 client Activation
The "client-activated object" is called by the clientNewOrActivator. createinstance ()Created on the server.
Code:

< Service >
< Activated Type = "Hello. helloservice, hello"  
Objecturi = "Helloservice. Soap"   />
</ Service >

The above describes the types of client activation. Please note that we do not need the URL any more, because for the client activation type, the type itself is enough to activate. In addition,WellknownMark as alreadyActivatedMark substitution.

6 remoting vs Web Service

Both are based on distributed development, and. Net remoting can also be configured as a Web Service, which has many similarities.

Generally, I listed their differences as five.

1) development and deployment
WebService development and deployment are relatively simple, and remoting is a little complicated than WebService development and deployment.
2) protocol openness
both Support HTTP, TCP, SMTP, and other protocols.
[I always thought that WebService only supports the HTTP protocol. According to idior, it was introduced in Web Services enhancements and WebService also supports TCP, SMTP and other protocols. The latest WSE version released by Microsoft should be WSE 3.0. I have never heard of it before. It's really embarrassing.]
more details to be continued...
3) supported type systems
WebService only supports XSD type systems. serialization of object types is limited, remoting can serialize data to binary to support a wider range of data types
4) Security
due to ASP. net web services depend on HTTP, so they are integrated with the standard Internet security infrastructure. ASP. NET leverages the security features of IIS to provide strong support for standard HTTP authentication schemes (including basic, brief, digital certificates, and even Microsoft. NET Passport.
in general, the. NET remoting pipeline cannot ensure the security of cross-process calls. Using ASP. NET to host. Net remoting endpoints in IIS, you can use all the security features available for ASP. NET web services, including support for SSL to ensure the security of wired communication.
5) Performance
in terms of original performance, the. NET remoting pipeline can provide the fastest communication when using TCP channels and binary formatting programs. In general,. Net remoting performs better than WebService.

The following summary comments:
The biggest difference between the two is that Web Service is recognized as a standard in the industry .. Net remoting is Ms's own stuff
========
Both WS and. Net remoting can use TCP and HTTP channels, both of which can use binary and soap formatter. Mainly:
1. ws are industry standards and remoting is part of the. NET Framework.
2. ws always need a "server", but remoting can be used to build a peer-to-peer client without a "server"
3. WS and remoting classes are different.

==========
However, because of their different standards, WS are usually used for cross-platform implementation, while. Net remoting is often used for internal LAN collaboration to achieve better results.
==========
WS supports HTTP TCP SMTP MSMQ
Specifically, HTTP and message queue are used. One Service supports synchronization and one service supports Asynchronization.
These have been implemented in WSE. WS is definitely not a chicken rib. WS is an important technical solution for enterprise integration.
Remoting is mainly used for distributed applications. Net to. net.

You quotedArticleIs 2002, too old.
Advanced remoting is a good book to learn about remoting.
==========
I don't quite understand what the landlord said, "BS, CS cannot be competent.
Under the binaryformatter of. Net remoting, applying to the C/S mode is the best choice. The XML Web Service, as mentioned above, adopts industry standards and uses the SOAP protocol and XML serialization to apply the B/S mode. The second is two different concepts ~~
==========

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.