[. NetRemoting-2], remoting-2

Source: Internet
Author: User

[. NetRemoting-2], remoting-2

[Remoting architecture]
[1] is an important component of. NetFramework.
[2] two important features of the framework
[A] basic implementation [B] scalability/customization

[Components]
[1] [client, client application domain]
[Composition]
[A] Proxy [Proxy]
[B] Formatter [Formatter]
[C] Channel]

[Key points]
1. Always interact with the server object through Proxy [Proxy]
2. [Proxy] knows the exact location of the Remote Object
[Proxy and remote object]
[A] The Client requests A property or method from the Proxy. The Proxy sends the request to the server object ==> [typical Proxy mode]
[B] binding relationship between proxy and remote object

[Proxy]
[Two parts]
[Transparent Proxy, Transparent Proxy]
Provides the same interface as the service object to convert [Stack Frame, Stack Frame] to [Message, Message]
[Real Proxy, Real Proxy]
Uses the [Formatter and Formatter] to serialize messages, [block] The client program, and send messages after strong serialization to [Channel, Channel]
Message]
[Process of sending a request from the client]
[Obj] --> [transparent proxy] --> [real proxy] --> [formatter] --> [Channel] ----> [arrive at server]

[2] [server, Host application domain]
[Composition]
[A] Channel [Channel]
[B] Formatter [Formatter]
[C] Stack Builder [Stack Builder]
Note]
[A] The Host Program keeps listening to the port opened by Remoting.

[Server processing process]
Keep listening --> [Channel receives Message] --> [Formatter, deserialization] --> [Stack Builder, create or retrieve an object, and call the object method to get the method return, and encapsulated as a message] --> [Formatter, serialization] -->
[Send to Channel] -----> [return to client]

* Three activation methods for Remoting object [transfer reference mails]
[Commonalities]
[Create a service object and keep it in the host domain]
[A] Activate Client activated on the Client]
==> Create an exclusive remote object to serve it, and the object State remains
==> Disadvantages:
(1) increasing the pressure on the server; (2) wasting system resources on the server [the server maintains the object state all the time]
[B .1] the Server activates Singleton. [Server activated Singleton]
==> All clients share the same object, but the following logs cannot re-create objects. The service type must provide constructors without parameters.
==> Consider Thread Synchronization
[B .2] the Server activates SingleCall. [Server activated SingleCall]
==> Create an object for each request, and 2. Return the support destroy object in each method.
==> It will not take too long to occupy Resources
==> Do not save the object status
==> Developers must write Program Logic maintenance bodies themselves
==> The service type must provide constructors without Parameters


[Server activation] ==> [Well-KnowOject, WKO]

Related Article

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.