Re: Synchronized objects

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Roger Crawfis (rcrawfis_at_columbus.rr.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 04:51:51 GMT

Ken,

Please see my answers below. I am still somewhat in the design mode, and
more interested in learning the technology than really building anything.
For my current interests though I have provided answers.

"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:OwKqYPOBFHA.1400@TK2MSFTNGP11.phx.gbl...
> What you've seen so far probably mostly involves either using a config
> file
> or the RemotingConfiguration class's static methods to identify certain
> types as remoted. This is nice when you want transparency in your code as
> to
> the source of the object -- you simply call "new MyObject()" and the
> remoting system instantiates the object remotely for you. However, as you
> noticed, it applies to all instances of a type, which, in your case, is
> not
> what you want.
>
> Luckily, there are other ways to instantiate remote objects that are
> instance-specific (e.g. Activator.GetObject() and
> Activator.CreateInstance()). In fact, there are several ways to get local
> proxies to remote objects and the appropriate one to use depends on how
> you
> plan to use the object in your clients and on your server. In your case,
> the
> two main relevant questions are:
>
> 1) Does every client that connects need to access the same Foo instance
> (foo4 in your case) or is each client going to be accessing its own,
> unique
> instance of Foo on the server?
>

Several clients will need to access the same instance. But they may also
want to access foo5, foo6, etc., hence multiple instances on the server. I
was trying to use the Activator.GetObject(), but even from the
documentation, it is not clear whether it creates a new instance or simply
creates a real proxy. It is also not clear how you specify which specific
instance you are allowed to connect to and how to connect to it.

> 2) Does the server need to be able to access or receive events from the
> Foo
> instances that are accessed by your client apps?
>

OK. I have to bang my head against the wall three time to figure out which
one is the "server". My first thought is to say no, the client can handle
all of the method invocations, if this is what you meant.
clientFooProxy.barMethod() versus serverInstanceProxyToClient.barMethod().
Events though may be different. I do want the server to subscribe to events
coming from the client. This is also not clear. No I simply do events as
normal once all of the proxies are set up?

> If you can answer those questions, I can steer you in the right direction
> for how to set up your remoting framework.
>

Much appreciated. Hopefully this was specific enough.

> Ken
>
>
> "Roger Crawfis" <rcrawfis@columbus.rr.com> wrote in message
> news:w78Kd.61443$re1.3177@fe2.columbus.rr.com...
>>
>> OK. I am a little lost on reading thru all of the rather simple examples
> for
>> remoting. It appears as if everything in .NET is type based, rather than
>> instance based. I want a simple demo to synchronize a particular instance
> of
>> an object. Consider this simple scenario. I have a type foo, which has a
>> public method bar. On my client, i want to create a local instance of
>> foo,
>> called foo1 which is totally disjoint from the server. I also want a
> second
>> instance of foo, foo2, which is a proxy to an instance on the server.
> Assume
>> the server also has two instances, foo3 and foo4. What I want is to
>> attach
>> foo2 to foo4. Everything else is a local vaiable. Do I need to create an
>> entirely new component (type) to have remoting work properly? Any
>> pointers
>> to a simple example that allows this Calling foo1.bar() should be local,
> but
>> calling foo2.bar() should use the remote state. I do not particularly
>> care
>> at this moment, whether it copies over the remote object
> (client-activated)
>> or passes the method invocation to the server. In summary, I want
>>
>> foo foo1 = new foo(); // local instance
>> foo foo2;
>> foo2 = proxy for remote.foo4 instance;
>>
>> Roger
>>
>>
>
>



Relevant Pages

  • Re: making test(1)s -nt/-ot ignore nanosecond fractions
    ... Changing it to microseconds precision is safer, ... foo 1084087769.000000000 ... foo has a normal mtime set by writing on the server ... should run on the client and set the times to ...
    (freebsd-current)
  • Three areas of confusion: instantiating remote objects locally on server side, extending the lifetim
    ... I'm working with remote objects for a client server application. ... Instantiating remote objects locally on the server side. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: .NET Remoting - client development/design-time and run-time requirements
    ... Service on my remote server. ... proxy object and the remote objects aren't instantiated on the server until ... My client is a hybrid ASP/ASP.NET ... remote object to take an additional, optional parameter. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: IP, hostnames and DNS issues
    ... > If the end user is giving you urls, they can be domain style or ip ... They aren't directly giving the server any URLs or similiar, ... see "who" the client is, as in whether it's an IP or hostname. ... it's only during initial creation of remote objects (we create about 10 ...
    (comp.lang.java.programmer)
  • Re: Solution with RMI?
    ... It can misfire if there are routers in between the server and the client which go up and down for minutes at a time. ... But you can prevent DGC happening at all by holding static references to your remote objects in the server JVMs. ... If you have high-availability requirements I believe you should look at RMI/IIOP, which is much the same thing but using a CORBA ORB as the runtime system instead of the RMI runtime system. ...
    (comp.lang.java.programmer)