Java web development solution

There are many options for the Java Web development program. Here are some classic development models to provide a reference for the selection of Java Web development models.

1. JSP + JAVABEAN development model

特点:该模式将业务逻辑与页面表现进行分离,在一定程度上增加了程序的可调试性和维护性。
缺点:页面将控制与显示集于一身。
结论:简单,适合小型项目的快速构建与运行。

2. JSP + Servlet + JavaBean development model

特点:JSP作为视图,来表现页面;Servlet作为控制器,控制程序的流程并调用业务进行处理;JavaBean封装了业务逻辑。遵循了MVC设计模式。
缺点:没有统一的开发框架导致开发周期长。

In MVC, the model part is responsible for managing system business data, the view part is responsible for displaying the interface, and the controller part is responsible for interaction with the user.

The technology of Servlet + JSP + JavaBean realizes the development of JavaWeb.

Servlet acts as a controller and is responsible for processing requests and controlling business processes;

JSP acts as a view and is responsible for outputting response results;

JavaBean acts as a model and is responsible for specific business logic and business data.

3. Struts development plan

特点:成熟的MVC开发框架。
构成:控制器:ActionServlet 组件:Struts框架的中央控制器。
              RequestProcessor 组件:每个子模块都具有的请求处理器。
              Action 组件:业务代理,它将调用模型进行一项具体的业务逻辑处理。
          视图:主要由JSP页面构成
                    还包括HTML文档;标准标签库(JSTL)和Struts标签库;
                    JavaScript脚本和CSS样式;
                    多媒体文件;
                    消息资源文件;
                    ActionForm类。
          模式:通常在Structs中使用其他模型组建来实现业务逻辑。
                   如:JavaBean技术、EJB技术、Hibernates设计模式。

Conclusion: For some large-scale projects, the Struts framework will improve the development efficiency and have great benefits for the later maintenance.

4. Spring development plan

Features: Based on two advanced technologies, IOC and AOP, it perfectly simplifies the complexity of enterprise-level development and is an ideal Web program framework.
Composition: core module: implements the IOC mode, including the BeanFactory class responsible for the configuration and management of JavaBeans.
Context module: Inheriting the BeanFactory class,
adding functions such as event processing, internationalization, resource loading, transparent loading, and data verification,
providing a framework-style Bean access method and many enterprise-level functions.
Such as: JNDI access, support EJB, remote call, inherit template framework, E-mail and scheduled task scheduling.
AOP module: Provides an AOP framework written in standard Java language,
which makes the application abandon the complexity of EJB, but has the key functions of traditional EJB.
DAO module: provides the JDBC abstraction layer, and provides support for declarative and programmatic transactions.
Web module: Based on the context module, it provides the Servlet listener's Context and Web application's context.
Provides integration to existing Web frameworks such as: JSF, Tapestry, Struts, etc.
O / R mapping module: provides support for existing ORM frameworks such as Hibernate.
Spring MVC framework: built on the core module, it is flexible enough to adapt to a variety of multi-view, template technology, internationalization and verification services, to achieve a clear separation of control logic and business logic.

5. Struts + HIbernate development plan:

特点:利用Struts的MVC设计模式,与Hibernate持久化对象组成的开发方案。

6, Struts + Spring + Hibernate development plan:
Features: Struts is responsible for the presentation layer,
Spring is responsible for the business of the logic layer, the operation
of the database in the Hibernate persistence layer, composed of the development plan.

Published 8 original articles · Likes2 · Visits 495

Guess you like

Origin blog.csdn.net/qq_42003546/article/details/102502974