

Serving an NSManagedObjectContext over an NSConnection - twampss
http://cocoawithlove.com/2009/01/serving-nsmanagedobjectcontext-over.html

======
tptacek
Love this blog (found it here). The idea is simple; in Ruby, you'd just be
doing:

    
    
      class CoreDataClient
    
       def method_missing(meth, *args)
    
          @socket.write(Marshal::dump[meth, args]))
    
          l = @socket.read(4).unpack("N").first
    
          Marshal::load(@socket.read(l))
    
       end
    
      end
    

You get the same effect in Cocoa by setting delegates.

We did used the same trick in our product to get the Subversion SWIG bindings
out of our Rails processes and into a dedicated evented server we could cache
in; we just replaced the SWIG interfaces with facades that turned method
invocation into network messages. Huge win.

