25-07-2012, 01:37 PM
MODEL VIEW CONTROLLER PATTERN
MODEL VIEW CONTROLLER PATTERN.pptx (Size: 546.01 KB / Downloads: 35)
Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.
The primary goal of MVC is to isolate UI changes and prevent them from requiring changes to the Domain Logic of the application.
MVC divides an application into three concerns:
Model - Encapsulates core application data and functionality Domain Logic.
View - obtains data from the model and presents it to the user.
Controller - receives and translates input to requests on the model or the view.
MVC
A model:
An object that stores data that often pertains to real world
responds to requests for information about its state (usually from the view),
and responds to instructions to change state (usually from the controller).
A view:
Some form of visualization of the state of the model.
A controller:
Offers facilities using which the user can change the state of the model.
clicking on buttons, sliding a slider, typing in a text box, etc.
Client Tier
The Client tier is the part the application that the user sees and interacts.
The Client tier is responsible for:
Presenting data to the user, interacting with the user
Communicating with other tiers of the application using well-defined interfaces.
A separate Client tier in the design provides flexibility and extensibility.
Future new clients can be written using technologies or languages that do not yet even exist, since they must conform only to the interface for communicating with other tiers
Web Tier
The Web tier is responsible for performing all Web-related processing, such as:
serving HTML,
formatting JSP pages for display by browsers.
managing database connections.
EJB Tier
Enterprise JavaBeans are components:
Extend servers to perform application-specific functionality.
hosts application-specific business logic and provides system-level services such as transaction management, concurrency control, and security.
The interface between these components and their containers:
Defined in the EJBs specification.
Essentially, the EJBs tier provides a component model for access to distributed system services and persistent data.
Enterprise Information System (EIS) Tier
The EIS tier is the enterprise information infrastructure.
To ensure that data are consistent across application boundaries.
Access to the EIS tier is usually transactional.
Enterprise information systems provide the information infrastructure critical to the business processes of an enterprise. Examples of EISs include relational databases, enterprise resource planning (ERP) systems, mainframe transaction processing systems
The EIS tier enforces security.
Advantages of MVC pattern
Separates Model from View:
Implies separating internal data representation from presentation
Easy to add multiple presentations of the same data
Facilitates adding new types of presentation of data as per requirement.
Model and View components can vary independently enhancing maintainability, extensibility, and testability.
Advantages of MVC design Pattern
Separating Controller from View
Permits run-time selection of an appropriate View based on user preference, or model state.
Separating Controller from Model
Allows configurable mapping of user actions on the Controller to application functions on the Model.
Drawbacks of the model
Increased complexity
Close coupling of views and controller to model
Potential for excessive updates
Close coupling between view and controller