SharePoint 2013 introduces the new SharePoint App model that essentially replaces the sandbox model of solution development. Apps are self contained and easily deployable even more so than sandbox solutions ever were in SharePoint 2010. Microsoft recommends to use apps rather than farm solutions whenever you can. Apps have the following advantages over farm solutions:

  • They provide users with the easiest discovery, purchase, and installation process.
  • They provide administrators with the safest SharePoint extensions.
  • They provide you with the simplest marketing and sales system based on a Microsoft-provided online app store.
  • They maximize your flexibility in developing future upgrades.
  • They maximize your ability to leverage your existing non-SharePoint programming skills.
  • They integrate cloud-based resources in smoother and more flexible ways.
  • They enable your extension to have permissions that are distinct from the permissions of the user who is running the app.
  • They enable you to use cross-platform standards, including HTML, REST, OData, JavaScript, and OAuth.
  • They enable you to leverage the SharePoint cross-domain JavaScript library to access SharePoint data. Alternatively, you can use a Microsoft-provided secure token service that is OAuth-compliant.
  • They can extend SharePoint Online websites as well as on-premises SharePoint websites.

Of course, farm solutions are still required in some instances where you need to run code on the server directly. The app model does not allow running code on the Server object model but uses the following APIs to access SharePoint:

  • SharePoint REST/OData service to access SharePoint sites, lists, and other data.
  • SharePoint JavaScript, Silverlight, or .NET Framework client object models.
  • On Windows Phones, you can use the SharePoint Windows Phone object model. 

The general guide is that farm solutions are still used for administrative type solutions that would deploy timer jobs, central administration features, PowerShell commands, etc. anything that would be of WebApplication, Farm, or Site Collection scoped. A guiding principle being that apps are for end-users and farm solutions for administrators.