From: Michael Garriss Date: 2003-08-01T07:53:05+09:00 Subject: Re: Extracting a parent class I suppose that containment is a good idea but I do have methods that expect objs of the client side base class. I could rewrite them to add the check the class of the incoming obj. I think that I will just continue to use to_SomeClass type methods. It's just a pain to have to keep them upto date. Eric Hodel wrote: >Michael Garriss (mgarriss@earthlink.net) wrote: > > > >>It is VERY possible that I should be doing it in another way. My >>motivation: I have a client/server arch. The server maintains objects >>and a database. When the client needs something I do not want the >>client to have full access to all the info found in those server side >>objects. Some of it would be bad for the client to know. I have >>classes the client side can use and I add the additional things the >>server knows about the object by creating a subclass of the client class >>and then just adding the one or two 'secret' members. Does this make sense? >> >> > >Perhaps containment would be a better solution than inheritance? > >class ClientThingy > attr :foo, :bar, :baz >end > >class ServerThingy > attr :client_thingy > > def initialize > @client_thingy = ClientThingy.new > end >end > >Also, have you looked at DRb? It will allow you to have a clean >division between server-side and client-side. > > >