title: What is the correct system design when dealing with third party API?
body: <p>This <a href="http://blog.njoubert.com/2010/12/structuring-iphone-apps-design-principles.html" rel="nofollow">blog post</a> by Joubert just opened my eyes. I have dealt with a lot of design patterns in Java and other languages. But Objective-C is a rather unique language.</p>
  
  <p>Let's say that in a project we talk with a third party API, like Dropbox or Facebook. What I've been doing so far is to combine everything that has to do with the third party API into a singleton class. So I can access the class from anywhere in my view controllers. I can just go for example: <code>[[DropboxModel sharedInstance] uploadFile:aFile]</code></p>
  
  <p>However as the blog post noted, this isn't efficient and leads to spaghetti code and bad unit testing. So what is the best way to design the system so that it's modular and easy to use?</p>