Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the technical framework diagrams in the J2EE domain

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What this article shares to you is about the technical framework diagram in the field of J2EE, which the editor thinks is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1.Spring architecture diagram

Spring is an open source framework created to address the complexity of enterprise application development. One of the main advantages of the framework is its hierarchical architecture, which allows you to choose which component to use, while providing an integrated framework for J2EE application development. The functionality of the Spring framework can be used in any J2EE server, and most of the features also apply to unmanaged environments. The core point of Spring is to support reusable business and data access objects that are not bound to specific J2EE services. Such objects can be reused between different J2EE environments (Web or EJB), stand-alone applications, and test environments.

Each module (or component) that makes up the Spring framework can exist alone or can be implemented jointly with one or more other modules. The functions of each module are as follows:

Core container: the core container provides the basic functions of the Spring framework. The main component of the core container is BeanFactory, which is the implementation of the factory pattern. BeanFactory uses the inversion of Control (IOC) mode to separate the application's configuration and dependency specifications from the actual application code.

Spring context: the Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, email, internationalization, checksum and scheduling capabilities.

Spring AOP: through the configuration management feature, the Spring AOP module integrates aspect-oriented programming capabilities directly into the Spring framework. Therefore, you can easily make any object managed by the Spring framework support AOP. The Spring AOP module provides transaction management services for objects in Spring-based applications. By using Spring AOP, you can integrate declarative transaction management into your application without relying on EJB components.

Spring DAO: the JDBC DAO abstraction layer provides a meaningful exception hierarchy that can be used to manage exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code that needs to be written (such as opening and closing connections). Spring DAO's JDBC-oriented exceptions follow the general DAO exception hierarchy.

Spring ORM: the Spring framework inserts several ORM frameworks, providing object-relational tools for ORM, including JDO, Hibernate, and iBatisSQLMap. All of this follows Spring's generic transaction and DAO exception hierarchy.

2.ibatis architecture diagram

Ibatis is a persistence layer framework based on Java. The persistence layer framework provided by iBATIS includes SQL Maps and DataAccess Objects (DAO), as well as an example of JPetStore developed using this framework.

IBATIS: the advantage of * is that it can effectively control the number of sql messages and improve the execution efficiency of the data layer! It requires programmers to write sql statements themselves, unlike hibernate is completely object-oriented, automatic, ibatis is semi-automatic, through table and object mapping and manual writing of sql statements, can achieve higher query efficiency than hibernate.

Ibatis just encapsulates the data access layer and does some object-relational mapping for us. But the price is that you have to write a xml configuration file, and you have to write a lot of sql compared to Hibernate. Hibernate generates entity classes and basic configuration files directly from the database schema through tools, and in most cases we do not need to write sql, which will greatly improve the efficiency of development. But these also have a lot of limitations, especially the high requirements of the environment (database design, object design, team collaboration, etc.). The personal feeling that Ibatis is meaningful to the project is that it is small, flexible, extensible, encapsulates the data access layer (transaction, cache, exception, log), and provides DAO framework support.

With Ibatis we can separate code from sql. As long as sql can solve problems, Ibatis can help us solve problems more easily and make our project less dependent on a framework (because Ibatis is non-intrusive). This will greatly reduce the project risk, reduce the time to solve complex problems, and make the maintenance of the project easier.

It will be easy and natural for Ibatis to modify, debug, expand and maintain applications. When making changes, we mainly modify the entity objects that represent the model, the sql in the xml configuration file, and / or the ResultMap of the configuration file (which is often not needed). At the same time, sql and code are separated, so we don't have to look for sql that needs to be modified between the append methods of the StringBuffer of the code. The sql in the configuration file facilitates our debugging and review of sql and future sql reuse.

3.struts1 architecture diagram

Struts is an Open Source project of the Jakarta project team of the Apache Foundation. It adopts the MVC model and can help java developers to develop Web applications using J2EE. Like other java architectures, Struts is an object-oriented design that takes advantage of the MVC schema's ability to "separate display logic from business logic". The core of the Structs framework is a flexible control layer based on standard technologies such as Java Servlets, JavaBeans, ResourceBundles and XML, as well as some Jakarta Commons class libraries. Struts consists of a set of collaborative classes (components), Serlvet, and jsptag lib. Web applications based on struts architecture basically meet the design standards of JSP Model2, which can be said to be a change of traditional MVC design patterns.

Struts has its own controller (Controller) and integrates other technologies to implement the model layer (Model) and view layer (View). At the model level, Struts can be easily combined with data access technologies, such as JDBC / EJB, and other third-party class libraries, such as Hibernate / iBATIS, or Object Relational Bridge (object Relational Bridge). In the view layer, Struts can work with JSP, including JSTL and JSF, as well as Velocity templates, XSLT and other presentation layer technologies.

Struts supports every professional Web application to help create an extended development environment for your application.

Client browser (customer browser):

Each HTTP request from the customer's browser creates an event. The Web container will return a HTTP Response.

Controller (Controller):

The controller receives the request from the browser and decides where to send the request. As far as Struts is concerned, the controller is a command design pattern implemented in servlet. Struts-config.xml file configures the controller.

Logic business logic:

The business logic updates the state of the model and helps control the flow of the application. In the case of Struts, this is done through the Action class, which is "thin" wrapped as the actual business logic.

Status of Model (model):

The model represents the state of the application. The business object updates the status of the application. ActionForm. Bean represents the state of the model at the session or request level, not at the persistence level.

View (View):

The view is an JSP file. There is no process logic, no business logic, no model information, only tags. Markup is one of the factors that distinguishes Struts from other template technologies such as Velocity.

4.struts2 architecture diagram

Struts 2 separates the implementation of user business logic (Action) from Servlet API relative to Struts 1.x. This separation mechanism uses an interceptor or interceptor stack (interceptor chain). Interceptor is one of the core contents of Struts 2.

Struts 2 has built-in multiple interceptors and interceptor stacks (a chain of interceptors) to intercept users' Web requests, thus providing richer functions, such as data type conversion, internationalization, file upload, and so on.

5.Hibernate architecture diagram

Hibernate is an open source object-relational mapping framework, which encapsulates JDBC with very lightweight objects, so that Java programmers can use object programming thinking to manipulate the database at will. Hibernate can be used in any situation where JDBC is used, not only in Java client programs, but also in Servlet/JSP Web applications. * Revolutionary significance is that Hibernate can replace CMP in the J2EE architecture of EJB to complete the important task of data persistence.

Hibernate has a total of five core interfaces, namely: Session, SessionFactory, Transaction, Query and Configuration. These five core interfaces will be used in any development. Through these interfaces, not only persistent objects can be accessed, but also transactions can be controlled. These five core interfaces are introduced below.

Session interface: the Session interface is responsible for performing CRUD operations on persisted objects. (the task of CRUD is to communicate with the database and contains many common SQL statements.) . It is important to note, however, that Session objects are not thread safe. At the same time, the session of Hibernate is different from HttpSession in JSP applications. When the term session is used here, it actually refers to the session in Hibernate, and the HttpSesion object will later be called the user session.

SessionFactory interface: the SessionFactory interface is responsible for initializing Hibernate. It acts as a proxy for the data storage source and is responsible for creating Session objects. Factory mode is used here. It is important to note that SessionFactory is not lightweight, because in general, a project usually requires only one SessionFactory, and when you need to operate on multiple databases, you can specify a SessionFactory for each database.

Configuration interface: the Configuration interface is responsible for configuring and launching Hibernate and creating SessionFactory objects. During the startup of Hibernate, an instance of the Configuration class first locates the mapping document, reads the configuration, and then creates a SessionFactory object.

Transaction interface: the Transaction interface is responsible for transaction-related operations. It is optional, and developers can also design and write their own underlying transaction code.

Query and Criteria interfaces: Query and Criteria interfaces are responsible for performing various database queries. It can be expressed in either the HQL language or SQL statements.

6.J2EE architecture diagram

J2EE is a set of technical architecture which is completely different from the traditional application development, including many components, which can simplify and standardize the development and deployment of the application system, and then improve the portability, security and reuse value.

The core of J2EE is a set of technical specifications and guidelines, including various components, service architecture and technical levels, all have common standards and specifications, so that there is a good compatibility between different platforms that follow the J2EE architecture, and solve the dilemma that the information products used in the back end of the enterprise are not compatible with each other, resulting in difficult communication within or outside the enterprise.

7.Oracle architecture diagram

The above are the technical framework diagrams in the field of J2EE, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report