title: Should I call my API from my model or controller?
body: <p>My question is mostly related to an architectural or design pattern for hierarchical models in Objective C. For background my app is relatively simple. In general it talks to a web service to retrieve and display things a user can follow. When someone follows something, the thing they are following is conceptually stored for access later by posting to the web service.</p>
  
  <p>I would like advice on where the logic should go to manage the interaction between the web service and the group of things a user follows. </p>
  
  <p>For example, is it appropriate to create a model object like <code>MyStuffModel</code> with an array property named <code>followedThings</code> that holds references to <code>AThingModel</code> objects? And if so, would the logic for refreshing from the web service, etc be written and executed in the model? </p>
  
  <p>Potential code example</p>
  
  <pre><code>@interface MyStuffModel : NSObject
  
  @property (nonatomic, strong) NSArray *followedThings;
  
  - (void)refreshAllFollowedThingsFromWebService;
  
  @end
  
  @implementation MyStuffModel
  
  - (void)refreshAllFollowedThingsFromWebService
  {
      //call my API client (built on AFNetworking), get back a response
      //populate followedThings, notify a view controller, etc
  
  }
  
  @end
  </code></pre>
  
  <p>Or, should I not have a <code>MyStuffModel</code> object and manage the calls to my web service by calling my API client directly from a view controller?   </p>
  
  <p>In your experience, which approach is desired? Or is there another way? </p>