Model View Controller
Essential Diagram employs the MVC (Model-View-Controller) design pattern to clearly separate data, presentation and user interaction.
Model
A model is a collection of nodes that are rendered onto a view and manipulated by a controller. The Diagram document represents the Model in this pattern.
View
A view is an object that draws a model onto a rectangular area in the screen. Views also render additional visual information that do not exist inside the model such as bounding boxes, coordinate axes and grids.
Views also provide methods to perform hit testing. When a mouse event occurs, the point at which the event occurred, is always given in device coordinates. Since the view maps the device coordinates and the world coordinates, it is the logical entry point for hit testing routines.
Controller
A controller is an object that receives user input and translates it into actions and commands on the model and view. A controller contains one or more tools, which are reusable objects that implement a slice of functionality for the controller.
The model, view and controller objects communicate with each other through well-defined interfaces.
Model-View-Controller Architecture for Essential Diagram
Benefits:
One significant advantage to this design is that the model, view and controller components are interchangeable. Users may swap them out with other components to build highly specialized applications.
Another key benefit of this design is that it reduces the complexity of the product, which in turn, increases reliability.
|