Re: Help on remoting clarification ???
- From: serge calderara <sergecalderara@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Feb 2006 12:50:34 -0800
as your last point :
[Afterthough: You can create a class that wraps the
IPurchaseOrderService on the client side that handles getting the
object reference fromt he remote service, and forwards all calls to
that remote proxy, effectively making it a web service like proxy
object... ]
All example I get arer working like this, they do not impleemnt or use any
interface. They get a reference of the remote object by using the
WellKnownServiceType function and then it retrun what is so call a tansparent
proxy that the client use.
Thats the reason why I was thinking that it was somehow posssible to create
an off line proxy class
serge
"NuTcAsE" wrote:
See inline:.
So If I understand, having the RemoteObject.dll separate from the server
offer the possibility to get the remoteObject and the server on different
tiers right ?
The right word you are looking for is Layers not Tiers. Tiers indicate
a physical boundary in an application, which means parts of the
application live on seperate machines, where remoting comes into play.
Layers reffer to the logical seperation of an application, for example
Data Access Layer (DAL), Business Logic Layer (BLL) and User Interface
Layer (UIL).
From a remote object component, if we want to buzild a client application
which will refer to that component, does the way to create this reference is
to have a local copy and then refer that copy within your project or is there
a way to generate an off line proxy class in a similar way as web service and
then refer to that class ?
There is no direct correlation to a Web Service proxy in the remoting
world. Remoting deals with interfaces rather than proxy. Maybe an
example will help:
Lets say i want to create a purchase order application where the
service allows clients to retrieve and store purchase orders... So I
create a common component library called PurchaseOrderLib. This library
contains the following:
1. An interface IPurchaseOrderService that defines two functions
PurhcaseOrder GetPurchaseOrder (int orderId);
PurchaseOrder SavePurchaseOrder (PurchaseOrder order);
2. A class PurchaseOrder that has the [Serializable] attribute applied
to it.
Now the IPurchaseOrderService becomes the interface contract that the
service uses to implement a remote service, and the client uses to
interact with the remote service.
Now i create a Windows application (console or otherwise) that contains
one class PurchaseOrderService that implements the
IPurchaseOrderService interface. This windows application now becomes
my remote service, which exposes the PurchaseOrderService as a well
known service through a Uri. (The purchase order service references the
PurchaseOrderLib.dll)
The Client part also references the PurchaseOrderLib.dll and then uses
Activator.GetObject () overlaod to connect to the remote service and
get the object that implements the IPurchaseOrderService and then calls
method on that remote proxy.
The key here is that the implementation of the service is never
distributed out to the client. Just the interface definition. In most
of the examples you might have read distribute the service object on
the client side too... which is a wrong practice as it is a maintanance
nightmare.
So the end strucutre is this:
PurchaseOrderService ->references PurchaseOrderLib.dll
PurchaseOrderClient -> references PurchaseOrderLib.dll
[Afterthough: You can create a class that wraps the
IPurchaseOrderService on the client side that handles getting the
object reference fromt he remote service, and forwards all calls to
that remote proxy, effectively making it a web service like proxy
object... ]
Hope this helps
- NuTcAsE
- References:
- Re: Help on remoting clarification ???
- From: serge calderara
- Re: Help on remoting clarification ???
- From: NuTcAsE
- Re: Help on remoting clarification ???
- Prev by Date: Re: Help on remoting clarification ???
- Next by Date: Re: Timeout before SocketException
- Previous by thread: Re: Help on remoting clarification ???
- Next by thread: "Permission denied: cannot call non-public or static methods remotely."
- Index(es):
Relevant Pages
|
Loading