You are on page 1of 10

Dot net remoting


The code written in one language should be used from
the application written in same or different languages
present in any system connected within a n/w
Solution is DCOM
 DCOM PROCESS MODEL:

CLIENT (LOCAL SYSTEM SERVER (REMOTE SYSTEM)

COM Server COM Server

Client Regis DCOM


of DCOM

APP PMA

Memory Block
Other Computer
 When ever an application uses the definitions
of the DCOM then a request will be given to
the COM server of the local system where the
DCOM server info will be identified using the
client registration of DCOM then based on this
information a request will be given to the COM
server of Remote system where the DCOM is
identified and the processing of the DCOM
might take place in the PMA of remote system
or in the memory block of client system or in
any specified computer based on the definition
of the DCOM.
 Once the processing is completed the result
will be given back to the application.
 Drawback  it has to be registered in the
client system always.
A Dot net assembly present in one system with .net
assembly present in another system
 Points to remember :
 Dot Net Remoting Architecture
 Channels to be used for communication between
the systems connected with in a network.
 How server has to provide the response to the
client request.
 How client application should send a request to
the server.
ARCHITECTURE

Remoting Remoting
System System
2 5 11 9
6

1 Proxy 10 Formatters 7

3 4 12 8

Dot Net Dot Net


Appli. assembly
 When ever the dot net application present in one
system uses the definitions of the .net assembly present
in another system then a request will be given to the
remoting system of the client which defines a proxy
where the “proxy” collects the information from the
client application and gives it to the remoting system to
the client.
 Once the remoting system of the client gets the client
requirement then it sends a request to the remoting
system of the server using channels where the dot net
assembly is identified and it will define the
“FORMATTERS” then the remoting system of the server
will give the response as a value or a reference to the
remoting system of the client based on the .net
assembly definitions.
 Once the response is received by the remoting system
of the client it passes the result to the proxy and from
the proxy to the client application.
 CHANNELS  these are physical communication media used
by the systems involved in dot net remoting. Dot net remoting
supports 2 channels HTTP channel and TCP channel
TCP CHANNEL HTTP CHANNEL
To use :- define an object for To use :- define an object for

“system.Runtime.Remoting. “system.Runtime.Remoting.
Channels.Tcp.Tcpchannel”
Always a special port has to Channels.HTTP.Httpchannel
No special port is required it
class
be opened exclusively for ” class
has a capability to use the
comm. default web server.
Supports Intranet based Supports Intranet and
applications Internet based applications
Cant pass the data or info. If Can pass the data across
any firewalls are defined firewalls
It is manditory to define the Can use default windows
custom security for the authentication provided
application which uses TCP provided by the web server
channel for its
communications
Performance is very fast Performance is slow
 Note  It is manditory to define at least one
channel and to register the channel to support
dot net remoting in all the systems which are
connected within a network and involved in
remoting.
 Syntax to register a channel
channelservices.registerchannel(channelobject)
 Syntax to unregister a channel
channelservices.unregisterchannel(channelobject
)
 Server can provide the response to the remoting
system of the client in 2 ways:
 1 } the result of the object might be serialized
and it might be given as a value to the client
system where serialization is a process of
maintaining the state of an object across the
network or within the system.
 2 } only the reference of the remote class object
will be given to the client system.
Note in order to use any assembly in remoting
infrastructure it is manditory that the remote
class has to either inherit “MarshallByRefObject”
or “MarshallByValueobject” class.
 MarshallByRefObject  when ever a remote class
inherits the MarshallByReference object class
then the response of the remote class object will
be given only as a reference to the remoting
system of the client from the remoting system of
the server.
 MarshallByValueobject  when ever a class
inherits MBV object class then the result of the
remote class object will be serialized and the
 Client can send a request to access the remote
class definitions in 2 ways:
 ServerActivatedObject Method  when ever an
object is defined for the remote class then the
remoting system of the server will try to define
an object at the server and process the request
and the result will be given to the client system
based on the definitions of the remote class.
It is of 2 types
 SingleCall Method  when ever the client uses
the single call method to use the definitions of
the remote class object then an object will be
defined at the server once the response is given
back to the application the object created at the
server will be implicitly garbage collected i.e. the
object will be destroyed.
 SingleTon Method  when ever the client
application uses the definitions of the remote
class using SingleTon method then for the ever
first request for the remote class an object will be
defined at the server which will have a capability
to send the response back to any no of
 Syntax to invoke the remote class object
definitions using serverActivatedobject method 

registerWellKnownServiceType(gettype(remotecl
ass),URL,Single call / SingleTon)

 ClientActivatedObject Method  when ever the


client application uses the definitions of the
remote class using client activated object then an
remote object will be defined and it will be
maintained by the client system only.

 Syntax to invoke the remote class object


definitions using ClientActivatedObject Method 

registerWellKnownServiceType(gettype(remotecl
ass),URL)

You might also like