SlideShare a Scribd company logo
1 of 32
Download to read offline
Fad-Free Architecture:
Sticking to the Basics for
Success
Justin Munger
CocoaHeads
July 12, 2016
Introduction
• Professional software developer for 18 years
• Independent contractor/consultant for 11 years
• Mobile development for 7 years
• Started in iOS in 2009, Android in 2010
• Shipped/fixed over 20 iOS/Android apps
Disclaimer
• This is one developer's opinion based on his
industry experience
• It's going to be biased
• There is no perfect architecture out there
• This is just one possibility that is working for me
• Sharing what I've learned
A Detour through
Contractorland
My Experience
• As a contractor, I've worked with a wide range of
companies on a wide range of apps
• Have worked with companies ranging in size from
small startups to multinational corporations
• Each company is like its own country with its own
unique culture and customs
• I get to see a LOT of different ways companies
operate, develop, and ship (or not ship) mobile apps
Why Do Companies Use
Contractors?
• Unable/unwilling to invest in software
development as a core component of their
business
• Unable/unwilling to find/acquire/invest in talent
• Broken app/teams in need of rescue
• Companies that operate with a "Units of Work"
environment
Units of Work
Environment
The "Units of Work"
Environment
• Software development is considered a means to an end rather
than a core business function
• Management treats software developers like unskilled labor,
line items in a budget, where developers are interchangeable/
replaceable units of work at an internal or external hourly rate
• Developers are put into play on teams, switched back and
forth between teams, or removed from teams as budgets shift
and time constraints change
• Needs specific to the thought-intensive nature of software
development are disregarded in favor of spatial efficiency
What Problems Does a "Units
of Work" Environment Cause?
• Development processes and management are lacking or non-existent
• Individual units of work drive development processes
• Parkinson's Law of Triviality (bike-shedding) starts to rule development
decisions with more of a focus on trivial but exciting topics that avoid dealing
with the mundane but critical aspects of delivering successful software
• This can lead to avoiding vanilla first-party SDKs in favor of trendy techniques
and third-party libraries that are perceived as more interesting
• The trendy techniques and third-party libraries used may not be part of an
architecture that is compatible with delivering sustainable working software
• Software developed in this manner may need to be scrapped, heavily
reworked, or will have a limited lifespan after its initial release
So What's Wrong with Trendy
Techniques and Third-Party Libraries?
• Nothing at all, they are merely techniques and tools to solve
problems
• Potentially everything if they don't solve the problem well (or
correctly), work against first-party frameworks/architectures,
or are poorly-or-not-at-all documented/supported
• Third-party libraries become YOUR code that YOU must
now own and maintain when it (inevitably) breaks
• If the third-party library is no longer maintained by the
original source and breaks, guess who becomes the new
maintainer?
What's So Special about
First-Party Components?
• For iOS development, they are made by Apple, who makes the software
and hardware that runs the platform
• They are made by people much smarter than most of us
• They are optimized to work best with other Apple frameworks
• They (usually) come very-well tested to ensure they work properly (more
so for more established frameworks than those that are brand-new)
• They come with complete documentation
• They live and are supported for as long as the platform is alive (unless
specifically deprecated)
• They have a VERY large community of support behind them
So What Does This All Have To
Do with Fad-Free Architecture?
• I'm often brought in to help clients who have a "Units of Work"
environment to get their applications working and under control
with a stable architecture
• The trendy techniques and third-party libraries used solved an
immediate problem (in a fun and interesting way) in one part of
the app, but failed to integrate well with other parts of the app
• Many times, by the time I'm brought in, the only way to get the
app functioning is to gut the entire application, removing trendy
implementations, stripping out third-party components, and re-
architecting the app piece-by-piece using first-party
components and tried-and-tested techniques
Fad-Free Architecture
Inspiration for Fad-Free
Architecture
• Marcus Zarra's MVC-N presentation at CocoaConf Chicago 2016
• Gives a good basis to start with understanding how to create a solid
app architecture based on MVC and first-party components from Apple
• Handles happy-path scenarios
• Needed some more definition to be usable for a foundation for an
actual application
• This talk will try to expand upon MVC-N to give a more usable blueprint
for application architecture
• Comes with a working implementation that you can clone from Github
and try yourself (https://github.com/justinkmunger/FadFreeArchitecture)
Fad-Free Architecture
• Keep UI and non-UI parts of the app separate as much as possible
• Contain non-UI parts of the app in a single-instance object, created
by AppDelegate and passed between view controllers through
standard segues and dependency injection (in prepareForSegue)
• "MVC is central to a good design for a Cocoa application" - Apple
• https://developer.apple.com/library/ios/documentation/General/
Conceptual/DevPedia-CocoaCore/MVC.html
• Rely on first-party (Apple) solutions as much as possible
• Only use third-party libraries if you're willing to learn how their code
works and be able to support them yourself when they break
Benefits of a Fad-Free
Architecture
• Separation of UI and non-UI concerns
• Helps enforce UI/non-UI code boundaries, allowing for
potential separation of non-UI code into its own reusable
framework
• Easier to unit-test
• Developers can focus their energy on solving business
problems with mature first-party frameworks
• Easier to staff projects when there's a larger pool of
developers that understand your code base
Increasing Complexity of
iOS SDK
Every year, it's becoming increasingly difficult for a single
developer to successfully master the entire iOS platform
https://david-smith.org/blog/2015/09/03/the-growing-ios-sdk/
Consequences of a Fad-
Free Architecture
• "Front-end" and "Back-end" iOS development
• Allows team members to specialize and focus
on specific parts of the application
• Platform is maturing to where applications can
be more effectively developed if specialization
occurs
When to Use a Fad-Free
Architecture
• When you're working on a project with
inexperienced team members
• When you need to make the application easy to
understand for other team members
• When you want to leverage tools designed
specifically for the platform
• When the application is code is going to change
hands to other developers or another client
When Not to Use a Fad-Free
Architecture
• When all team members are guaranteed to be mid- or
senior-level who are staying with a company long-term
and will continue to be working on the project
throughout its entire lifespan
• When the company retains ownership of the code and
it does not exchange hands for someone else to take
over or maintain
• When experimenting with new technologies in
applications that are for internal use and/or are
experimental
High-Level Overview
What Does a Fad-Free
Architecture Look Like
UIViewController
PersistenceControllerNetworkController
DataController
(Facade)
Fad-Free Architecture
Key Components
UIViewController
• Only responsible for displaying UI and receiving input
from the user
• Receives an instance of DataController when it is
instantiated
• First visible view controller kicks off persistence
initialization in DataController
• Once initialization is complete, it can start using
DataController methods
• Accesses the DataController for anything non-UI related
DataController
• Access point into the non-UI portion of the application
• Instantiated in AppDelegate as a single instance (not a
singleton)
• Passed through to all UIViewControllers that need access to it
using dependency injection
• Holds references to and coordinates activity between all other
controllers for the application
• Vends configured components to the UI layer
• Provides a "facade" to allow access into it
DataController Facade
• Implemented as extensions on DataController with
functions and computed variables
• Functions take raw parameters and completion closure
used to indicate success/failure in UI
• Functions create instances of NSOperations from other
controllers and coordinate their execution through
dependencies
• Functions implement NSOperation completion closures
which use the closures passed in to the functions to call
back to the UI code with success/failure
NetworkController
• Handles all access to network resources
• Implements NSURLSession with a delegate
callback interface
• Wraps NSURLSessionTasks in NSOperations that
are handled by NSOperationQueue
• Returns JSON data to DataController facade
function (through NSOperation completion
callback) for processing
PersistenceController
• Handles all persistence in the application
• Relies heavily on Core Data and associated
classes to implement persistence
• Contains Core Data initialization and managed
object context save logic
Walkthrough
Any Questions?
Thanks!
• Slides and code are at:

https://github.com/justinkmunger/
FadFreeArchitecture
• Email: justinkmunger@gmail.com
• Twitter: @justinmunger

More Related Content

What's hot

Agile architecture revolution iasa itarc
Agile architecture revolution   iasa itarcAgile architecture revolution   iasa itarc
Agile architecture revolution iasa itarcJason Bloomberg
 
The error of their ways
The error of their waysThe error of their ways
The error of their waysScott Nimrod
 
Architecture In An Agile World
Architecture In An Agile WorldArchitecture In An Agile World
Architecture In An Agile WorldJames Cooper
 
Hierarchical Composable Optimization of Web Pages
Hierarchical Composable Optimization of Web PagesHierarchical Composable Optimization of Web Pages
Hierarchical Composable Optimization of Web PagesHayim Makabee
 
The error of their ways
The error of their waysThe error of their ways
The error of their waysScott Nimrod
 
Module 2-web-a11y-steve lee
Module 2-web-a11y-steve leeModule 2-web-a11y-steve lee
Module 2-web-a11y-steve leeSteve Lee
 
The 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating systemThe 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating systemAidan Tierney
 
Evaluating Blockchain Companies
Evaluating Blockchain CompaniesEvaluating Blockchain Companies
Evaluating Blockchain CompaniesMike Slinn
 
We’re Doing What, When? Incorporating UX Design Into Agile
We’re Doing What, When? Incorporating UX Design Into AgileWe’re Doing What, When? Incorporating UX Design Into Agile
We’re Doing What, When? Incorporating UX Design Into AgileSu-Laine Yeo Brodsky
 
Introductie slides Continuous Delivery 3.0
Introductie slides Continuous Delivery 3.0Introductie slides Continuous Delivery 3.0
Introductie slides Continuous Delivery 3.0Maikel Meeuwse
 
Html5 today
Html5 todayHtml5 today
Html5 todayRoy Yu
 
Managing Accessibility Compliance in the Enterprise
Managing Accessibility Compliance in the EnterpriseManaging Accessibility Compliance in the Enterprise
Managing Accessibility Compliance in the EnterpriseKarl Groves
 
Assistance with Android: Tactical to Strategic
Assistance with Android: Tactical to StrategicAssistance with Android: Tactical to Strategic
Assistance with Android: Tactical to StrategicCommonsWare
 
Design Types
Design TypesDesign Types
Design Types1&1
 
Integrating accessibility in the organization's web development lifecycle
Integrating accessibility in the organization's web development lifecycleIntegrating accessibility in the organization's web development lifecycle
Integrating accessibility in the organization's web development lifecycleAccessibilitéWeb
 
Agile paris 2022 sharing
Agile paris 2022   sharingAgile paris 2022   sharing
Agile paris 2022 sharingJas Chong
 

What's hot (19)

Agile architecture revolution iasa itarc
Agile architecture revolution   iasa itarcAgile architecture revolution   iasa itarc
Agile architecture revolution iasa itarc
 
Demystify DevOps
Demystify DevOpsDemystify DevOps
Demystify DevOps
 
The error of their ways
The error of their waysThe error of their ways
The error of their ways
 
Architecture In An Agile World
Architecture In An Agile WorldArchitecture In An Agile World
Architecture In An Agile World
 
Hierarchical Composable Optimization of Web Pages
Hierarchical Composable Optimization of Web PagesHierarchical Composable Optimization of Web Pages
Hierarchical Composable Optimization of Web Pages
 
The error of their ways
The error of their waysThe error of their ways
The error of their ways
 
Module 2-web-a11y-steve lee
Module 2-web-a11y-steve leeModule 2-web-a11y-steve lee
Module 2-web-a11y-steve lee
 
The 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating systemThe 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating system
 
Evaluating Blockchain Companies
Evaluating Blockchain CompaniesEvaluating Blockchain Companies
Evaluating Blockchain Companies
 
We’re Doing What, When? Incorporating UX Design Into Agile
We’re Doing What, When? Incorporating UX Design Into AgileWe’re Doing What, When? Incorporating UX Design Into Agile
We’re Doing What, When? Incorporating UX Design Into Agile
 
Introductie slides Continuous Delivery 3.0
Introductie slides Continuous Delivery 3.0Introductie slides Continuous Delivery 3.0
Introductie slides Continuous Delivery 3.0
 
Area View
Area ViewArea View
Area View
 
Whats my MVP?
Whats my MVP?Whats my MVP?
Whats my MVP?
 
Html5 today
Html5 todayHtml5 today
Html5 today
 
Managing Accessibility Compliance in the Enterprise
Managing Accessibility Compliance in the EnterpriseManaging Accessibility Compliance in the Enterprise
Managing Accessibility Compliance in the Enterprise
 
Assistance with Android: Tactical to Strategic
Assistance with Android: Tactical to StrategicAssistance with Android: Tactical to Strategic
Assistance with Android: Tactical to Strategic
 
Design Types
Design TypesDesign Types
Design Types
 
Integrating accessibility in the organization's web development lifecycle
Integrating accessibility in the organization's web development lifecycleIntegrating accessibility in the organization's web development lifecycle
Integrating accessibility in the organization's web development lifecycle
 
Agile paris 2022 sharing
Agile paris 2022   sharingAgile paris 2022   sharing
Agile paris 2022 sharing
 

Similar to Fad-Free Architecture

Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...
Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...
Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...Steve Greenley
 
Engage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryEngage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryJared Roberts
 
Mobile App Development: Off the-Shelf vs Platform
Mobile App Development: Off the-Shelf vs PlatformMobile App Development: Off the-Shelf vs Platform
Mobile App Development: Off the-Shelf vs PlatformDipesh Mukerji
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesAlfred Jett Grandeza
 
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentAxway Appcelerator
 
Developing for Windows 8 based devices
Developing for Windows 8 based devicesDeveloping for Windows 8 based devices
Developing for Windows 8 based devicesAneeb_Khawar
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureKelly Goetsch
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Top 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App DevelopmentTop 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App Developmenttechugo
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for youAmbientia
 
Construction Software & Technology Applications: What fits your biz?
Construction Software & Technology Applications: What fits your biz?Construction Software & Technology Applications: What fits your biz?
Construction Software & Technology Applications: What fits your biz?Bridgit
 
Multi Platform User Exerience
Multi Platform User ExerienceMulti Platform User Exerience
Multi Platform User ExerienceTanya Zavialova
 
Interact2011 - Designing Inter-usable Systems
Interact2011 - Designing Inter-usable SystemsInteract2011 - Designing Inter-usable Systems
Interact2011 - Designing Inter-usable SystemsVille Antila
 
Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Indiginox
 
How Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development ProcessHow Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development Process3Play Media
 
1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterpriseScott Simmons
 

Similar to Fad-Free Architecture (20)

Innoslate for Academia
Innoslate for AcademiaInnoslate for Academia
Innoslate for Academia
 
Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...
Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...
Steve Greenley July 2015 - Enterprise Architecture and True Agility - lessons...
 
Engage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryEngage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation Story
 
java advert
java advertjava advert
java advert
 
Mobile App Development: Off the-Shelf vs Platform
Mobile App Development: Off the-Shelf vs PlatformMobile App Development: Off the-Shelf vs Platform
Mobile App Development: Off the-Shelf vs Platform
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry Practices
 
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
 
Developing for Windows 8 based devices
Developing for Windows 8 based devicesDeveloping for Windows 8 based devices
Developing for Windows 8 based devices
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright Future
 
Mendix Platform
Mendix PlatformMendix Platform
Mendix Platform
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Top 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App DevelopmentTop 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App Development
 
Making software development processes to work for you
Making software development processes to work for youMaking software development processes to work for you
Making software development processes to work for you
 
Construction Software & Technology Applications: What fits your biz?
Construction Software & Technology Applications: What fits your biz?Construction Software & Technology Applications: What fits your biz?
Construction Software & Technology Applications: What fits your biz?
 
Multi Platform User Exerience
Multi Platform User ExerienceMulti Platform User Exerience
Multi Platform User Exerience
 
Interact2011 - Designing Inter-usable Systems
Interact2011 - Designing Inter-usable SystemsInteract2011 - Designing Inter-usable Systems
Interact2011 - Designing Inter-usable Systems
 
Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?
 
How Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development ProcessHow Oracle Integrates Accessibility into the Development Process
How Oracle Integrates Accessibility into the Development Process
 
Prototyping
PrototypingPrototyping
Prototyping
 
1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise
 

Fad-Free Architecture

  • 1. Fad-Free Architecture: Sticking to the Basics for Success Justin Munger CocoaHeads July 12, 2016
  • 2. Introduction • Professional software developer for 18 years • Independent contractor/consultant for 11 years • Mobile development for 7 years • Started in iOS in 2009, Android in 2010 • Shipped/fixed over 20 iOS/Android apps
  • 3. Disclaimer • This is one developer's opinion based on his industry experience • It's going to be biased • There is no perfect architecture out there • This is just one possibility that is working for me • Sharing what I've learned
  • 5. My Experience • As a contractor, I've worked with a wide range of companies on a wide range of apps • Have worked with companies ranging in size from small startups to multinational corporations • Each company is like its own country with its own unique culture and customs • I get to see a LOT of different ways companies operate, develop, and ship (or not ship) mobile apps
  • 6. Why Do Companies Use Contractors? • Unable/unwilling to invest in software development as a core component of their business • Unable/unwilling to find/acquire/invest in talent • Broken app/teams in need of rescue • Companies that operate with a "Units of Work" environment
  • 8. The "Units of Work" Environment • Software development is considered a means to an end rather than a core business function • Management treats software developers like unskilled labor, line items in a budget, where developers are interchangeable/ replaceable units of work at an internal or external hourly rate • Developers are put into play on teams, switched back and forth between teams, or removed from teams as budgets shift and time constraints change • Needs specific to the thought-intensive nature of software development are disregarded in favor of spatial efficiency
  • 9.
  • 10. What Problems Does a "Units of Work" Environment Cause? • Development processes and management are lacking or non-existent • Individual units of work drive development processes • Parkinson's Law of Triviality (bike-shedding) starts to rule development decisions with more of a focus on trivial but exciting topics that avoid dealing with the mundane but critical aspects of delivering successful software • This can lead to avoiding vanilla first-party SDKs in favor of trendy techniques and third-party libraries that are perceived as more interesting • The trendy techniques and third-party libraries used may not be part of an architecture that is compatible with delivering sustainable working software • Software developed in this manner may need to be scrapped, heavily reworked, or will have a limited lifespan after its initial release
  • 11. So What's Wrong with Trendy Techniques and Third-Party Libraries? • Nothing at all, they are merely techniques and tools to solve problems • Potentially everything if they don't solve the problem well (or correctly), work against first-party frameworks/architectures, or are poorly-or-not-at-all documented/supported • Third-party libraries become YOUR code that YOU must now own and maintain when it (inevitably) breaks • If the third-party library is no longer maintained by the original source and breaks, guess who becomes the new maintainer?
  • 12. What's So Special about First-Party Components? • For iOS development, they are made by Apple, who makes the software and hardware that runs the platform • They are made by people much smarter than most of us • They are optimized to work best with other Apple frameworks • They (usually) come very-well tested to ensure they work properly (more so for more established frameworks than those that are brand-new) • They come with complete documentation • They live and are supported for as long as the platform is alive (unless specifically deprecated) • They have a VERY large community of support behind them
  • 13. So What Does This All Have To Do with Fad-Free Architecture? • I'm often brought in to help clients who have a "Units of Work" environment to get their applications working and under control with a stable architecture • The trendy techniques and third-party libraries used solved an immediate problem (in a fun and interesting way) in one part of the app, but failed to integrate well with other parts of the app • Many times, by the time I'm brought in, the only way to get the app functioning is to gut the entire application, removing trendy implementations, stripping out third-party components, and re- architecting the app piece-by-piece using first-party components and tried-and-tested techniques
  • 15. Inspiration for Fad-Free Architecture • Marcus Zarra's MVC-N presentation at CocoaConf Chicago 2016 • Gives a good basis to start with understanding how to create a solid app architecture based on MVC and first-party components from Apple • Handles happy-path scenarios • Needed some more definition to be usable for a foundation for an actual application • This talk will try to expand upon MVC-N to give a more usable blueprint for application architecture • Comes with a working implementation that you can clone from Github and try yourself (https://github.com/justinkmunger/FadFreeArchitecture)
  • 16. Fad-Free Architecture • Keep UI and non-UI parts of the app separate as much as possible • Contain non-UI parts of the app in a single-instance object, created by AppDelegate and passed between view controllers through standard segues and dependency injection (in prepareForSegue) • "MVC is central to a good design for a Cocoa application" - Apple • https://developer.apple.com/library/ios/documentation/General/ Conceptual/DevPedia-CocoaCore/MVC.html • Rely on first-party (Apple) solutions as much as possible • Only use third-party libraries if you're willing to learn how their code works and be able to support them yourself when they break
  • 17. Benefits of a Fad-Free Architecture • Separation of UI and non-UI concerns • Helps enforce UI/non-UI code boundaries, allowing for potential separation of non-UI code into its own reusable framework • Easier to unit-test • Developers can focus their energy on solving business problems with mature first-party frameworks • Easier to staff projects when there's a larger pool of developers that understand your code base
  • 18. Increasing Complexity of iOS SDK Every year, it's becoming increasingly difficult for a single developer to successfully master the entire iOS platform https://david-smith.org/blog/2015/09/03/the-growing-ios-sdk/
  • 19. Consequences of a Fad- Free Architecture • "Front-end" and "Back-end" iOS development • Allows team members to specialize and focus on specific parts of the application • Platform is maturing to where applications can be more effectively developed if specialization occurs
  • 20. When to Use a Fad-Free Architecture • When you're working on a project with inexperienced team members • When you need to make the application easy to understand for other team members • When you want to leverage tools designed specifically for the platform • When the application is code is going to change hands to other developers or another client
  • 21. When Not to Use a Fad-Free Architecture • When all team members are guaranteed to be mid- or senior-level who are staying with a company long-term and will continue to be working on the project throughout its entire lifespan • When the company retains ownership of the code and it does not exchange hands for someone else to take over or maintain • When experimenting with new technologies in applications that are for internal use and/or are experimental
  • 23. What Does a Fad-Free Architecture Look Like UIViewController PersistenceControllerNetworkController DataController (Facade)
  • 25. UIViewController • Only responsible for displaying UI and receiving input from the user • Receives an instance of DataController when it is instantiated • First visible view controller kicks off persistence initialization in DataController • Once initialization is complete, it can start using DataController methods • Accesses the DataController for anything non-UI related
  • 26. DataController • Access point into the non-UI portion of the application • Instantiated in AppDelegate as a single instance (not a singleton) • Passed through to all UIViewControllers that need access to it using dependency injection • Holds references to and coordinates activity between all other controllers for the application • Vends configured components to the UI layer • Provides a "facade" to allow access into it
  • 27. DataController Facade • Implemented as extensions on DataController with functions and computed variables • Functions take raw parameters and completion closure used to indicate success/failure in UI • Functions create instances of NSOperations from other controllers and coordinate their execution through dependencies • Functions implement NSOperation completion closures which use the closures passed in to the functions to call back to the UI code with success/failure
  • 28. NetworkController • Handles all access to network resources • Implements NSURLSession with a delegate callback interface • Wraps NSURLSessionTasks in NSOperations that are handled by NSOperationQueue • Returns JSON data to DataController facade function (through NSOperation completion callback) for processing
  • 29. PersistenceController • Handles all persistence in the application • Relies heavily on Core Data and associated classes to implement persistence • Contains Core Data initialization and managed object context save logic
  • 32. Thanks! • Slides and code are at:
 https://github.com/justinkmunger/ FadFreeArchitecture • Email: justinkmunger@gmail.com • Twitter: @justinmunger