www.digitalmars.com         C & C++   DMDScript  

D - dummy question & proxy

reply "Lloyd Dupont" <lloyd galador.net> writes:
I just wonder (out of curiosity) if there is a way to dynamically create new
class ?
I mean I have a given class, I want to create a proxy for it, is it possible
?
how ?
Mar 17 2003
next sibling parent reply Bill Cox <Bill_member pathlink.com> writes:
In article <b55vvn$2rg3$1 digitaldaemon.com>, Lloyd Dupont says...
I just wonder (out of curiosity) if there is a way to dynamically create new
class ?
I mean I have a given class, I want to create a proxy for it, is it possible
?
how ?
No dynamic class creation. Dynamic class creation is useful, but requires a compiler or interpreter be present at run-time. What is a proxy for a class? Bill
Mar 17 2003
parent "Lloyd Dupont" <lloyd RemoveIfNotSpamming.galador.net> writes:
It's for RPC mechanism.
If I want to do write a remote object mechanism I need to have some local
object (called proxy) which act
locally as an instance of a given object but when its method are called, it
write to a sockect an encoded version of the method call, which is decoded
by the server at the other side, which call the corresponding object and
respond with both (or either) the exception or return value, decode locally
by the proxy, then returned.

      Proxy               Internet             RPCServer    ServerObject
+ ---------------+----------------------+----------------+----------------+
 | myMethod() |--> "coded call"--> | decodeCall() | myMethod() |
 | decodeRet()  |--< "code ret"  <-- | encodeRet()  |

for this I would need a way to create dynamic instance or, at least I need
some concept like interface.
either I write a generator of InterfaceProxy code or create them dynamically
(if possible) is not so important, but to be able to create them dynamically
would be nice ....

"Bill Cox" <Bill_member pathlink.com> a écrit dans le message de news:
b560ud$2s2d$1 digitaldaemon.com...
 In article <b55vvn$2rg3$1 digitaldaemon.com>, Lloyd Dupont says...
I just wonder (out of curiosity) if there is a way to dynamically create
new
class ?
I mean I have a given class, I want to create a proxy for it, is it
possible
?
how ?
No dynamic class creation. Dynamic class creation is useful, but requires
a
 compiler or interpreter be present at run-time.

 What is a proxy for a class?

 Bill
Mar 18 2003
prev sibling parent "John Reimer" <jjreimer telus.net> writes:
"Lloyd Dupont" <lloyd galador.net> wrote in message
news:b55vvn$2rg3$1 digitaldaemon.com...
 I just wonder (out of curiosity) if there is a way to dynamically create
new
 class ?
 I mean I have a given class, I want to create a proxy for it, is it
possible
 ?
 how ?
Uh... Do you mean dynamically create a new class object? By proxy, do you mean an object alias perhaps?
Mar 17 2003