Lauriapple1 / ModularDemo

Sample Code from a Talk Held at the Cocoaheads Berlin October 2015 Meeting
Other
9 stars 5 forks source link

Modular iOS Application Architecture Demo Project

Sample Code from a Talk Held at the Cocoaheads Berlin October 2015 Meeting

An example how to structure an iOS application using modules.

When creating a modular system, instead of creating a monolithic application (where the smallest component is the whole), several smaller modules are written separately so that, when composed together, they construct the executable application program. _Source: Wikipedia._

Design Decisions:

A Service Locator is used to decouple modules from their dependencies.

Regarding structuring dependencies, see “Design information flow” in WWDC 2014 Session 229: Advanced iOS Application Architecture and Patterns.

Regarding asynchronous modularization techniques, see “Subdivide app into independent subsystems” in WWDC 2012 Session 712: Asynchronous Design Patterns with Blocks, GCD, and XPC.

Note that for passing data across asynchronous boundaries (which interfaces can represent) it might be advisable to use some Future– or Rx–style library. Otherwise I would discourage most other global dependencies, since it tends to become a PITA fast.