Model View Controller Framework
The Model-View-Controller (MVC) paradigm is a design pattern used for creating applications. It partitions the separate concerns of application data, user interface and application logic into three discrete components. It has proven highly successful in simplifying application design and maintenance.
The Ejscript Web Framework is a Model-View-Controller environment that provides a structure and assistance for your MVC application. It provides the basis and connections between your models, views and controllers and routes messages between the various components.
Ejscript makes MVC programming easy by providing base classes that implement most of the plumbing for an MVC application.
The model is responsible for managing access to application data and state. It is also responsible for ensuring the data remains valid and consistent.
The view is responsible for rendering the user interface and presenting the application to the user. Views should not manage incoming requests — that is the job of Controllers.
Controllers manage the application and respond to client requests. They orchestrate the application's response, access and update model data, and display views back to the client. Incoming requests invoke Actions in the controller which modify the application state and ultimately render a view.
Ejscript routes requests by parsing and decoding request URLs and matching them with the appropriate Controller and Action function. Ejscript provides the Controller class that provides methods for interacting with models and rendering views.