MVC mode and Java Web Application

xiaoxiao2021-03-06  14

The MVC architecture is proposed with the development of the SmallTalk Language language, it is a famous user interface design architecture. The classic MVC architecture divides a component (one module that can be considered to be the entire application) into three partial groups M Model to manage the data and values ​​used in this module, such as the maximum minimum value of a data or the slider on the interface. The location and other data are located. How to display the user, C Controller determines how to handle the user and the module's interactive event, such as the user click on a button. As J2EE's decisions continue to improve, people have discovered that the MVC architecture to design Web Application is quite appropriate. The role of M can be implemented by Delegate Class, and servlet can act as a Controller role. JSP can act as a view of View's role C must do without a JSP code under the concept of View, I think this sentence is that the MVC V is VIEW without restrictions on how to access the data, and we can even directly access the database directly in JSP. It is to provide a user interface display service, although it violates the three-story mode but does not violate the MVC architecture. The Web Application uses the Struts framework to implement the MVC architecture. The page interacts with the corresponding Action, and the Action is submitted from the new data submitted from the new data submitted and then submitted to the Class of the implementation of business logic. However, due to the need for FormBean and established Taglib unable to meet the needs of complex page data display, we still need some viewhelper class to assist the VIEV side. Designing a project I think is the first three-tier mode, design the relevant Integration layer and the Business layer method class and then consider how the Presentation interacts with the Business layer, this is the key. In fact, STURTS is just the role of Front Controller in the Presentation in the J2EE Core Pattern in Sun. Delegate Class refers to a class specific to the business delegate mode. Business delegate Sturts can refer to this picture.

转载请注明原文地址:https://www.9cbs.com/read-47899.html

New Post(0)