defined contracts Composition final program as sum result of many simple parts Simplicity small and well defined parts delivering one function Testability promotes isolation checks and test doubles
Mobile Application C IDENTIFY THE MODULE Remote Services Avail. Service Booking Service Payment Service Application Layer Application Layer Service Layer
Module identifies business value by fulfilling a set of user stories. • Modules have configuration and customisation capabilities (UI, Flow, BL,…) as every customer wants to be unique. • Modules are black boxes for the outside world. DEFINE REUSE
Flight Selection Next Module Navigation Data Model Converter for the View Listens to View events Business Rules User Interface No B. Logic View Services Router
Domain Model to View Model mapping • User interaction • Apply business rules • Service orchestration Overall, there are too many reason to change the ViewModel - Single responsibility principle violated.
Listens to View events Business Rules Flight Search Flight Summary Flight Selection Next Module Navigation User Interface No B. Logic View Model View Services Router
Selection Next Module Navigation Listens to View events Business Rules Data Model Converter for the View User Interface No B. Logic Presenter View Services Router
Converter for the View Flight Search Flight Summary Flight Selection Next Module Navigation User Interface No B. Logic Business Rules View Model Presenter View Services Router
Converter for the View Flight Search Flight Summary Flight Selection Next Module Navigation User Interface No B. Logic Business Rules Interactor View Model Presenter View Services Router
Converter for the View Flight Search Flight Summary Flight Selection Next Module Navigation User Interface No B. Logic Business Rules Interactor View Model Presenter View Services Router
is modal? To_Module accepts a delegate which is a component of the From_Module (usually the Presenter) Router FEW GOTCHAS From Module To Module Router provides out data needed by the next Builder Builder
you can use Shared Modules (don’t forget about coupling!) • Specialisation of components via Subclassing or Decoration • Handle Modules distribution and versioning via CocoaPods and use Subspecs for component granularity • Changes to the Module may sometimes touch many internal components