Skip to content

Controller mediation pattern

The Controller mediation pattern is a development concept primarily associated with Angular (specifically AngularJS, implied by the context of "controller") architecture^[600-developer__frontend__angular__angular-02.md].

It addresses the lack of direct interoperability between Angular's logic and the browser's native JavaScript environment.^[600-developer__frontend__angular__angular-02.md]

Core Characteristics

The pattern arises from the fact that standard Angular and JavaScript environments are fundamentally isolated from one another^[600-developer__frontend__angular__angular-02.md].

Isolation of Contexts

Functions, variables, and events are not interoperable or "互通" (interchangeable/communicable) between the standard JavaScript context and the Angular context without specific handling^[600-developer__frontend__angular__angular-02.md].

Mediation Role

To bridge this gap, a Controller acts as the necessary mediator or processor^[600-developer__frontend__angular__angular-02.md]. All interactions or data sharing that must occur between the disparate environments must be routed through this controller layer to function correctly^[600-developer__frontend__angular__angular-02.md].

Development Mode

In this architectural pattern, the application's development focus is shifted towards data manipulation and state management within the controller, rather than direct DOM manipulation typical of traditional JavaScript12^[600-developer__frontend__angular__angular-02.md].

  • [[Angular]]
  • [[MVVM]]

Sources

  • 600-developer__frontend__angular__angular-02.md

  1. Inferred from source listing "數據" (Data) as the development mode. 

  2. Inferred from the necessity of the controller in this specific isolation context.