title: Cocoa and REST: Should API details go in the model or in an API class?
body: <p>I have a RESTful server and need to create the client in a Cocoa app.</p>
  
  <p>I have a model called <strong>Resource</strong>. When I GET /resources, my server returns all resources in JSON.</p>
  
  <p>I have a model called <strong>Client</strong> that owns many resources.</p>
  
  <p>The Client has an instance method <strong>-(NSMutableArray*)resources</strong></p>
  
  <p>An NSArrayController manages the resources. The first time the above method is called, it asks the REST server for the client's resources.</p>
  
  <p>My question is this: who should create the request, dispatch the request, and populate the array: the Client class or the Resource class (with something like -(NSMutableArray*)resourcesForClient:(Client*)client )? Or maybe neither, instead there being an API class that receives the model name and some filters and returns the array?</p>