Advantages of MVC
Previous Home Next

Using the MVC design pattern, have many advantages:-

  • Greater flexibility:- It’s easy to add different View types (HTML, WML, XML) and interchange varying data stores of the Model because of the clear separation of layers in the pattern.
  • Ease of maintenance/:- The structure and flow of the application are clearly defined, making them easier to understand and modify.
  • Best use of different skill sets:- Most important advantage of such frame work is designers can work on the View, programmers more familiar with data access can work on the Model, and others skilled in application development can work on the Controller. Due to layers are distinct easier to developer.
  • Reusability:- MVC allow to reusing the component and changing one layer's code speculation with minimal effect on the other layer.
  • Portable:- Code one time define and used in many project with slight change in programming.

Concept of Struts framework

The Jakarta Project's Struts framework, version, from Apache Software Foundation (ASF) is an open source framework for building web applications that integrate with standard technologies, such as Java Servlets, JavaServer Pages, JavaBeans, Business logic and TagLibrary . Struts framework including Model 2 implementation of Model-View-Controller (MVC) design patterns in JSP web applications, which offers many benefits to the web application developer. The MVC Model 2 paradigm applied to web applications lets you separate display code (for example, HTML and tag libraries) from flow control logic (action classes).

Brief description of Model-View-Controller(MVC)

  • The Model portion of an MVC-based system typically comprises JavaBean classes that define the internal state of the system; they also specify the actions that can be taken to change that state.
  • The View portion of a Struts-based application is generally constructed using JSP technology. JSP pages can contain static HTML (or XML) text called "template text", plus the ability to insert dynamic content based on the interpretation (at page request time) of special action tags.
  • The Controller portion of the application is focused on receiving requests from the client (typically a user running a web browser), deciding what business logic function is to be performed, and then delegating responsibility for producing the next phase of the user interface to an appropriate View component.
  • Basically, a framework provide three main key components:

    • A "request" handler provided by the application developer that is mapped to a standard URI.
    • A "response" handler that transfers control to another resource which completes the response.
    • A "Tag Library" that helps developers create interactive form-based applications with server pages.
    Previous Home Next