News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Needs of Struts

Started by thiruvasagamani, Aug 28, 2008, 07:30 PM

Previous topic - Next topic

thiruvasagamani

Although a dynamic web application can be developed using JSP and Servlet technology, there are many problems.

    * Tightly coupled classes - one change affects other classes

    * Business logic resides in both presentation and data access layer. So if there is a change in a business rule, needs multiple places to find the business rules. Also promotes duplicate business rules.

    * Data sources are difficult to change as data access methods may be used in the presentation layer.

    * Logic to determine what to do next is across the application,no centralized decision.

To solve these problems,we need a mechanism that can separate the presentation layer of a web application from business logic. Luckily we have MVC and we have Struts. MVC is a design pattern (best practice method) that separates the application design into there main parts:

Model, View and Controller

    * Model - data and logic (business logic methods).

    * View - output displayed to the user

    * Controller - takes the input from the user and passes it to the relevant  model. The model returns and based on the result, the controller decides which view (page) to show the user.

Thiruvasakamani Karnan