Model–view–adapter

Model–view–adapter

Model–view–adapter (MVA) or mediating-controller MVC is an architectural pattern and multitier architecture, used in software engineering. In complex computer applications that present large amounts of data to users, developers often wish to separate data (model) and user interface (view) concerns so that changes to the user interface will not affect data handling and that the data can be reorganized without changing the user interface. MVA and traditional MVC both attempt to solve this same problem, but with two different styles of solution. Traditional MVC arranges model (e.g., data structures and storage), view (e.g., user interface), and controller (e.g., business logic) in a triangle, with model, view, and controller as vertices, so that some information flows between the model and views outside of the controller's direct control. The model–view–adapter solves this rather differently than the model–view–controller does by arranging model, adapter or mediating controller, and view linearly without any connections whatsoever directly between model and view.

Contents

View and model do not communicate directly

The view is completely decoupled from the model such that view and the model can interact only via the mediating controller or adapter in between the view and the model.[1] Via this arrangement, only the adapter or mediating controller has knowledge of both the model and the view, because it is the responsibility of solely the adapter or mediating controller to adapt or mediate between the model and the view—hence the names adapter and mediator. The model and view are kept intentionally oblivious of each other. In traditional MVC, the model and view are made aware of each other, which might permit disadvantageous comingling of view (e.g., user interface) concerns into the model (e.g., database) and vice versa, when the architecture might have been better served by the schema of the database and the presentation of information in the user-interface are divorced entirely from each other and allowed to diverge from each other radically. For example in a text editor the model might best be a piece table (instead of, say, a gap buffer or a linked list of lines), but the user interface should present the final resting state of the edits on the file, not some direct information-overload presentation of the piece-table's meticulous raw undo-redo deltas and incremental operations on that file since the current editing session began.

Model is intentionally oblivious of views

This separation of concerns permits a wide variety of different views to indirectly access the same model either via exactly the same adapter or via the same class of adapters. For example, one underlying data-storage model and schema and technology could be accessed via a wide variety multiple different views—e.g., Qt GUI, Microsoft MFC GUI, GTK+ GUI, Microsoft .NET GUI, Java Swing GUI, Silverlight website, and AJAX website—, where (unlike traditional MVC) the model is kept completely oblivious of what information flows toward these user interfaces. The adapter or class of adapters keeps the model completely oblivious that it is supporting multiple of the user interfaces and perhaps even supporting this variety concurrently. To the model, these multiple types of user interface would look like multiple instances of a generic user oblivious of type of technology.

View is intentionally oblivious of models

Likewise, any one user interface can be kept intentionally oblivious of a wide variety of different models that may underlie the mediating controller or adapter. For example, the same website can be kept oblivious of the fact that it can be served by an SQL database server such as PostgreSQL, Sybase, or SQL Server that has business logic built into the database server via stored procedures and that has transactions that the server may roll back or B) by an SQL database server such as MySQL that lacks one or more of these capabilities, or C) by a nonSQL RDF database, because the website interacts only with the mediating controller or adapter and never directly with the model.

Multiple adaptors between the same model-view pair

Additionally, multiple adapters may be created to change the way one view presents data for a given model. For example, different governments (either among different states of the USA or different nation-states internationally) may impose different codes of law, that in turn impose different business logic for the same underlying database and for the same outwardly-presented website. In this scenario, a class of various adapters or mediating controllers can represent the variations in business logic among these jurisdictions in between the same database model and the same website view.

  1. ^ [1] Sun's mediating-controller MVC

Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Model-view-adapter — (MVA) is an architectural pattern, which at the same time is also a Multitier architecture, used in software engineering. In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data… …   Wikipedia

  • Model-view-controller — (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the …   Wikipedia

  • Model View Controller — Konzept. Hinweis: die durchgezogene Linie symbolisiert eine direkte Assoziation, die gestrichelte eine indirekte Assoziation (zum Beispiel über einen Beobachter). Model View Controller (englisch  model view controller (MVC), deutsch auch: M …   Deutsch Wikipedia

  • Model–view–controller — A general representation of the MVC design pattern. Model view controller concept. The solid line represents a direct as …   Wikipedia

  • RGB color model — RGB redirects here. For other uses, see RGB (disambiguation). A representation of additive color mixing. Projection of primary color lights on a screen shows secondary colors where two overlap; the combination of all three of red, green, and blue …   Wikipedia

  • TRS-80 Model 100 — Developer Kyocera, Tandy, Microsoft Release date 1983 (1983) …   Wikipedia

  • Allis-Chalmers Model G — Front view of an Allis Chalmers G Rea …   Wikipedia

  • Windows Display Driver Model — (WDDM, also WVDDM) is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista. The WDDM is used by the graphics card drivers to provide the functionality required to render the… …   Wikipedia

  • TCP/IP model — See also: Internet Protocol Suite The TCP/IP model (Transmission Control Protocol/Internet Protocol) is a descriptive framework for the Internet Protocol Suite of computer network protocols created in the 1970s by DARPA, an agency of the United… …   Wikipedia

  • 3-Schichten-Architektur — Model View Controller Konzept. Hinweis: die durchzogene Linie symbolisiert eine direkte Assoziation, die gestrichelte eine indirekte Assoziation (z. B. über einen Beobachter). Model View Controller (MVC, „Modell/Präsentation/Steuerung“)… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”