Re: DO and Proxy Indirection
Re: DO and Proxy Indirection
- Subject: Re: DO and Proxy Indirection
- From: Ondra Cada <email@hidden>
- Date: Thu, 9 May 2002 18:55:47 +0200
On Thursday, May 9, 2002, at 06:16 , email@hidden wrote:
|Say I have two objects talking remotely. Let's call the first one
|Factory-A, and the second one Repository-B. The factory has registered
|with the centralized repository so that the repository can ask it to
|create objects on its behalf. Now, a third object, GUI-C, wants to talk
|to the repository, and ask for objects. Can the repository simple do
|something like:
|
|@implementation repository
|
|- (id)getObjectWithID:(NSString*)identifier
|{
| return [factory getObjectWithID:identifier];
|}
|
|@end
So far as I understand the question, it can.
First off, as I understand DO, if the repository wants to call factory
methods, the repository has to get a client object from the factory,
rather than the factory registering with the client. (That is, the caller
has to establish the connection.)
I think we presumed the connection was already established. Anyway, it is
unimportant which side did that; the DO communication is truly
peer-to-peer, with the only client/server difference when the connection
is actually established. From the moment on, both "client" and "server"
are quite equal.
If you want the factory to be able to call repository methods as well
(necessary if the factory is actually registering with the repository),
the factory has to be given a proxy object for the repository. (Each
direction of communication requires that the calling object have a proxy
for the called object.)
Ouch. I am lost, sorry.
Assuming that the repository calls the factory, and not vice versa, then
the above method will (probably) return a proxy object for whatever the
factory creates. (I say "probably" because I'm not 100% certain that DO
will *always* return a proxy under all circumstances.)
It does not, see "bycopy".
|? In the GUI-C address space, do we end up with a
|proxy-to-a-proxy-to-an-object, or with simply a proxy-to-an-object?
NSConnection uniques its proxies, so no "proxy chains" should ever occur.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.