From: jason@... (Jason Voegele) Date: 2001-09-27T23:32:24+09:00 Subject: [ruby-talk:21772] Transparent Proxies Hello all, I'm trying to implement a persistent object store similar to an Object Oriented Database. One feature of this object store is on-demand loading of objects, such that an object is only loaded from the database when it is needed. I've been thinking about the various ways to implement this but have not come up with a satisfactory solution. There was some time back a discussion about the possibility of adding a "become" feature (ala Smalltalk) to Ruby that would provide exactly what I need, but it appears that there were many problems with "become" that prevent it from being added to the language. I know also that there is a standard "delegate" package for Ruby, but there are other problems with this, such as "delegate.class" won't return the right thing, and seemingly severe performance problems noted in this post: http://groups.google.com/groups?q=delegate&hl=en&group=comp.lang.ruby&rnum=4&selm=fWQS6.109749%24I5.25755148%40news1.rdc1.tn.home.com What I'm looking for is a means of implementing a transparent proxy, such that things like "proxy.class" work as expected and allows the proxy to be replaced with the actual object when it becomes necessary, and all of this without being "too" slow. Any ideas? C++ tends to do this by allowing pointers to "fault" and catching the exception. I don't think I can do this in Ruby, and I'm not sure that I'd want to anyway. Thanks, Jason Voegele