柚子Nan--回归原点

Everything can be as easy as you like or as complex as you need.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

关于.NET Remoting乱七八糟的笔记 1

Posted on 2005-01-07 14:32  柚子Nan  阅读(797)  评论(0)    收藏  举报

The following  is only for notes. If you don't want to see it, please close the Browser :)
With all the attention paid recently to Web service,many developers don't realize that the true successor to DCOM is actually .NET Remoting.And what an improvement it is.

Some tech:
server-activated objects versus client-activated objects
formatters
channels
lifetime issues
security
configuration files

What is Remoting?
Remoting is the process of programs or components interacting across certain boundaries.These contexts will normally resemble either different processes or machines.

Remote objects and mobile objects
Nowdays(如今)
feasible (可行的)

Web Services provided the first easy to understand and implement solution to true cross-platform and corss-language interoperability.Web Services technically are stateless calls to remote components via HTTP POST with a payload encoded in some XML format.
You can choose between HTTP/SOAP for the internet or TCP/binary for LAN applications

The proxy encapsulates the connection to the remote object on the client and forwards calls to a stub object on the server,which in turn passes them on the real object.

ByObjRef.  You can think of the ObjRef as networked pointer that shows on which server the object lives and contains an ID to uniqueley identify the object.The client will usually not have the compiled objects in one of its assembilies;instead only an interface or a base class will be available.Every method,including property get/set,will be executed on the server.


ByValue objects,with these objects are passed over remoting boundaries,they are serilized into a string or a binary representation and restored as a copy on the other side of the communications channels.The client has to have the compiled object in one of its assemblies.The only other requirement for an object to be passable by value is that is supports serialization.

Samples:

When using remote objects, both client and server must have access to the same interface definitions and serializable objects that are passed by value.This leads to the general requirment that at least three assemblies are need for any .NET Remoting project: a shared assembly,which contains serializable objects and interfaces or base classes to MarshalByRefObjects;
a server assembly,which implements the MarshalByRefObjects; and a client assembly,which consumes them