The controller

The controller manages communication between the view and the model. It also encapsulates the functionality that is specific just to governing the interaction between various logical components, as a result of which model and view subsystems remain decoupled. The controller can be termed as the binding element between the model and views.

The software virtue that MVC exhibits is modularity, which helps developers to manage the complexity of developing an application. It allows the model, view, and controller modules to focus on a limited range of functionality. In short, it allows them to specialize.

As a general rule, the modular design is preferred over a holistic one.

MVC is unique among the patterns that we have looked ...

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.