Tuesday, May 14, 2013

Explain MVC architecture relating to J2EE?


MVC stands for Model-View-Controller architecture. It divides the functionality of displaying and maintaining of the data to minimise the degree of coupling (i.e. promotes loose
coupling) between components.


A model represents the core business logic and state. A model commonly maps to data in the database and will also contain core business logic.
A View renders the contents of a model. A view accesses the data from the model and adds display logic to
present the data.
A Controller acts as the glue between a model and a view. A controller delegates the request to the model for application logic and state and also centralises the logic for dispatching the request to the next view based on the input parameters from the client and the application state. A controller also decouples JSP pages and the Servlet by handling the view selection.

No comments:

Post a Comment