|
|
MVA OverviewFrom $1Table of contentsMVA OverviewThe Model-View-Adapter (MVA) pattern is a next generation application model Bungee Labs has created to enable richer, more responsive user interactivity, delivered 100% via standard web browsers without the need for plug-ins. Bungee Connect employs the MVA pattern to:
Similar to the Model View controller ((MVC)) pattern, MVA separates business logic (the Model) from presentation (the View). Unlike MVC, Bungee’s MVA approach lets developers efficiently manage and control the volume and range of screen activity, user gestures and service orchestrations expected of rich client-side web applications. A key principle of MVA is the absolute separation of Model and View, in contrast to most large MVC-pattern implementations, which are prone to co-mingling of special case logic in all three domains. Interfaces, the A in MVA, act as controller agents without requiring the developer to specify the controller instance logic each time Models and Views are required to interact. Interfaces separate the Model and View completely without any co-mingling, and manage all interactions, updates, and flow of control. Bungee Connect provides a rich set of interfaces, which can be combined to facilitate a broad range of user interactions, updates, data transformations, and flow of control scenarios. Interfaces act as connector agents and strictly enforce the Model-View separation without compromising control or flexibility. Views have a single, high-level binding to a Model element, such as a field, and the interface enables binding and customization of that data. Interfaces connect the Model to different interactive elements within the View such that they are managed, monitored and updated in a just-in-time, granular fashion without creating any explicit interdependency between Model and View. How MVA differs from MVC:Like its predecessor, Model View Controller (MVC), the Model-View-Adapter (MVA) pattern helps developers manage the complexity of applications having multiple ways to access and/or update a centralized business process or data source. The MVC pattern proliferated when "page-at-a-time" interaction for web applications was the norm, due to the technical constraint of completing full page, round trip, HTTP requests. (For Example: a user fills out an ecommerce shopping cart with product, address and payment information and presses submit, and receives a confirmation page in response.) When designing traditional, full-page-refresh web applications of this type, controller logic can be relatively simple. But this simplicity has given way to complexity as AJAX has become more popular and end-users have come to expect more interactive interfaces delivered through the browser. With richer user web interfaces, the number of interrelationships that need to be maintained, synchronized and reflected in user interface presentation and feedback multiply, making the interaction between View and Model much more difficult to implement and manage. The MVA pattern creates a much cleaner separation of the Model and the View by flattening the structure from a triangular one (in MVC) to a horizontal hierarchy (in MVA). Flattening the architecture of the applications created using MVA decreases dependencies so there is no bleeding of code across definitional node boundries (e.g., between the Model and the View, or between the Controller and the Model as often occurs in applications built using MVC). Use of the flat hierarchy provided in MVA allows for increased cleanliness in coding and easy reuse of components built using MVA. For example, in an application like Bungee Connect’s WideLens reference application, the range of different user actions is quite broad, and interactivity and user feedback are pervasive throughout the application. In a traditional MVC pattern, the developers would have to design, code and manage each of these interaction patterns specifically for each instance of the control. In addition, because MVC does not typically deal with state management/flow or automation, developers would have to create the facilities to keep track of the global implications of all permutations of Views. In Bungee's MVA implementation these adapters and state information flows are managed by Bungee Connect interfaces. Because interfaces themselves may be reused across the application, MVA dramatically reduces and even eliminates entirely the typical controller logic required by traditional MVC platforms. The code that MVA obviates relative to typical MVC implementations is in large part the un-manageable “glue” code that is not easily encapsulated for reuse in other parts of an MVC application. Generally in MVC implementations, the controller logic and the overall communication protocol between Model, View and Controller (sometimes called the "wire-up") are largely left to the developer to design and implement. The developer is responsible for defining and managing the ongoing enforcement of separation boundaries. The policies defining the Model/View separation are easily and inconsistently compromised by developers both during initial development and over the life-cycle of an MVC-based application - resulting in blurred distinctions between Model, View and controller code areas , leading to cumbersome application performance and increasingly complex development requirements.
This automation provisioned through Bungee’s implementation of MVA enables developers to rapidly create responsive AJAX interfaces without creating and managing triggers, listeners/observers, or other polling and event management facilities. Using MVA, the flow of state can be fully automated, from the UI elements presented in the browser all the way back to the server-side Model objects, and back out to the UI, including the necessary transformations of state and data formats normally required when associating Model data in multiple presentation contexts. Summary: The Benefits of MVA for Developers
Tags:
|