communicate with one another. .NET objects are exposed to remote processes, thus allowing interprocess communication.
The applications can be located on the same computer, different computers on the same network, or even computers across
Rules of Remoting:
- There must be 2 independent devices.
- One have functionality and another will access that functionality.
- Functionality must be in running or active mode e.g. Television must be in running mode to work with remote
An Example of remoting is that we have have SQL Server and SQL Server client edition. Here Client edition tool work as remote. Same with Oracle also.
If we implement such functionality then we use Remoting. It could be 1-tier or other architectures.
When a call is made from the Client a Marshall object is created at the server.
Marshall Object: This is special type of object that catch request, analyze, execute functionality and reply Data/
There are two type of Communication between Server and Client.
Singleton- if SMO(Single Marshall Object) handles MR(Multiple Request).
Single Call- if MMO( Multiple Marshall Object)s Handles MR(Multiple Request).
the server location. communication is not done directly it is done by proxy.
Proxy contain two parts
Stub- This implement the Skelton.
Skeleton- Contains Rules of Communication.
Server contain Skelton and Client contain Stub. Stub communicate with the Skeleton.
Three things required to implement the Remoting
Business Login – Marshall Object./
Skeleton at Server
Stub at Client
First Create Business Logic that served to the client:
create a class that inherits Class MarshalRefObject. To do this create new project and select class library as in Fig below.
that we have placed on server named as xyz.
.NET Remoting versus Distributed COMIn the past interprocess communication between applications was handled through Distributed COM, or DCOM. DCOM
works well and the performance is adequate when applications exist on computers of similar type on the same network.
However, DCOM has its drawbacks in the Internet connected world. DCOM relies on a proprietary binary protocol that
not all object models support, which hinders interoperability across platforms. In addition, have you tried to get DCOM to
work through a firewall? DCOM wants to communicate over a range of ports that are typically blocked by firewalls. There
are a ways to get it to work, but they either decrease the effectiveness of the firewall (why bother to even have the firewall
if you open up a ton of ports on it), or require you to get a firewall that allows support for binary traffic over port 80.
.NET Remoting eliminates the difficulties of DCOM by supporting different transport protocol formats and communication
protocols. This allows .NET Remoting to be adaptable to the network environment in which it is being used.
.NET Remoting versus Web Services
Unless you have been living in a cave, or are way behind in your reading, you have probably read something about Web
services. When you read the description of .NET Remoting it may remind you a lot of what you're read about Web services.
That is because Web services fall under the umbrella of .NET Remoting, but have a simplified programming model and are
intended for a wide target audience.
Web services involve allowing applications to exchange messages in a way that is platform, object model, and programming
language independent. Web services are stateless and know nothing about the client that is making the request. The clients
communicate by transferring messages back and forth in a specific format known as the Simple Object Access Protocol, or
SOAP. (Want to get some funny looks in the hallway? Stand around in the hallway near the marketing department with your
colleagues and discuss the benefits of using SOAP).
The following list outlines some of the major differences between .NET Remoting and Web services that will help you to
decide when to use one or the other:
- ASP.NET based Web services can only be accessed over HTTP. .NET Remoting can be used across any protocol.
- Web services work in a stateless environment where each request results in a new object created to service the request.
.NET Remoting supports state management options and can correlate multiple calls from the same client and support
- Web services serialize objects through XML contained in the SOAP messages and can thus only handle items that can
be fully expressed in XML. .NET Remoting relies on the existence of the common language runtime assemblies that
contain information about data types. This limits the information that must be passed about an object and allows objects
to be passed by value or by reference.
- Web services support interoperability across platforms and are good for heterogeneous environments. .NET Remoting
requires the clients be built using .NET, or another framework that supports .NET Remoting, which means a