From: Michael Garriss Date: 2003-08-01T07:30:14+09:00 Subject: Re: Extracting a parent class Well, not laugh., but I am using DRb. I've had a difficult time figuring out it all, seems to be a lack or docs or I'm just bad at finding them. example of what I am doing: class ServerObject < ClientObject def to_client_side_version # blah end end class Server def get_me_an_obj @server_obj.to_client_side_version end end ... class Client def ask_for_obj @server.get_me_an_obj end end .... # this is a 3rd file that I called shared that I put on both sides # I know there must be another way, plz help class ClientObject end 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. > > >