[MUD-Dev] Persistent Worlds

Ryan Rhodes ryanshaerhodes at hotmail.com
Sun Feb 25 10:09:37 CET 2001


Jon Lambert wrote:

> In C++ I use the idiom of wrapping objects up in psuedo-objects or
> tokens and overloading the dereference operators.  That way you
> present an class interface to the client that walks, talks, and
> looks like the class it is wrapping, but allows you to "trap" an
> object access.  

Sounds like J C is using the dereferencing to trap it as well.  Ok, so
I won't be able to do it in java with a simple description in C++.
Java has automatic dereferencing so I have no control over it
whatsoever.  Operator overloading isn't allowed either.  Anyone have
any other methods to "trap" object accesses?

I was reading up on java's dynamic proxy class.  You can tell java the
object you want a proxy for and it hands you a generic proxy.  Methods
calls on the proxy are echo'd to the original object through the
proxy.  This sounds like the same basic idea as the wrapper except
you've added extra overhead on every method call instead of on every
dereference.  If I build my world out of proxies instead of actual
objects is this going to hurt performence significantly?

Ryan Rhodes
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list