Some technical frameworks in the J2EE Field

Source: Internet
Author: User

1. Spring architecture Diagram

Spring is an open-source framework created to solve the complexity of enterprise application development. One of the main advantages of the Framework is its layered architecture, which allows you to choose which component to use and provides an integrated framework for J2EE application development. The functions of the Spring framework can be used on any J2EE server. Most of the functions are also applicable to unmanaged environments. Spring supports reusable services and data access objects that are not bound to a specific J2EE service. Such objects can be reused between different J2EE environments (Web or EJB), independent applications, and test environments.

Each module or component that makes up the Spring framework can exist independently or be implemented together with one or more 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 mode. BeanFactory uses reverse control IOC) mode to separate application configuration and dependency specifications from actual application code.
Spring context: the Spring context is a configuration file that provides context information to the Spring framework. Spring context includes enterprise services, such as JNDI, EJB, email, internationalization, checksum and scheduling.
Spring AOP: With the configuration management feature, the Spring AOP module directly integrates Aspect-oriented programming functions into the Spring framework. Therefore, any objects managed by the Spring framework can easily 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 applications without relying on EJB components.
Spring DAO: The jdbc dao abstraction layer provides a meaningful exception hierarchy for managing Exception Handling and error messages thrown by different database vendors. Exception hierarchies simplify error handling and greatly reduce the number of exception codes to be written, such as opening and closing connections ). JDBC-oriented exceptions of Spring DAO follow the common DAO exception hierarchy.
Spring ORM: The Spring framework inserts several ORM frameworks to provide ORM Object Relational tools, including JDO, Hibernate, and iBatisSQLMap. All of these comply with the general transactions and DAO exception hierarchies of Spring.

2. ibatis architecture Diagram

Ibatis is a Java-based persistent layer framework. The persistence layer framework provided by iBATIS includes SQL Maps and DataAccess Objects DAO). It also provides a JPetStore instance developed using this framework.

 

IBATIS: The biggest advantage is that it can effectively control the number of SQL sends and improve the execution efficiency at the data layer! It requires programmers to write SQL statements by themselves. Unlike hibernate, it is fully object-oriented and automated. ibatis is semi-automated. Through ing between tables and objects and manually written SQL statements, higher query efficiency than hibernate.

Ibatis only encapsulates the data access layer and performs partial object relationship ing for us. However, the cost is that the xml configuration file must be written, and a lot of SQL statements must be written relative to Hibernate. Hibernate uses tools to directly generate entity classes and basic configuration files from the database mode. In most cases, we do not need to write SQL statements, which greatly improves the development efficiency. However, these also have many limitations, especially those with high environmental requirements, such as database design, Object design, and team collaboration ). I personally think that what makes Ibatis meaningful to the project is that it is small, flexible, and scalable. It encapsulates transactions, caches, exceptions, and logs at the data access layer, and provides DAO framework support.

Using Ibatis, we can separate code from SQL. As long as SQL can solve the problem, Ibatis can help us solve it easily, it also makes our project less dependent on a framework because Ibatis is non-invasive ). This greatly reduces project risks, reduces the time required to solve complex problems, and simplifies project maintenance.

Ibatis makes it easy to modify, debug, expand, and maintain applications. During the modification, we mainly modify the Entity objects that represent the model, the SQL statements in the xml configuration file, and/or the ResultMap in the configuration file, which is usually not required ). At the same time, SQL and code separation, we do not need to find the SQL to be modified between the Code's StringBuffer append method. The SQL in the configuration file facilitates our debugging and SQL review and subsequent SQL reuse.

3. struts1 Architecture

Struts is an Open Source project of the Jakarta Project Team of the Apache Foundation. It adopts the MVC mode and can help java developers develop Web applications using J2EE. Like other java architectures, Struts is also an object-oriented design that gives full play to the capabilities of the MVC mode "separated display logic and business logic. The core of the Structs framework is an elastic control layer, based on standard technologies such as Java Servlets, JavaBeans, ResourceBundles and XML, and some class libraries of Jakarta Commons. Struts has a group of collaborative Class components), Serlvet and jsptag lib. Web applications based on the struts architecture basically comply with the design standards of JSP Model2, and can be said to be a change type of the traditional MVC design pattern.

Struts has its own Controller), while integrating some other technologies to implement Model layer Model) and View layer View ). At the model layer, Struts can easily be combined with data access technologies, such as JDBC/EJB and other third-party class libraries, such as Hibernate/iBATIS, or 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 provides support for every professional Web application to help you create an extended development environment for your application.

Client browser ):

Create an event for each HTTP request from the client browser. The Web Container returns an HTTP Response.

Controller ):

The Controller receives a request from the browser and determines where the request is sent. For Struts, the controller is a command Design Mode Implemented by servlet. Struts-config.xml file configuration controller.

Logic business Logic:

The business logic updates the model status and helps control the application process. For Struts, this is done by using the Action class packaged as the actual business logic "thin.

Model) status:

The model indicates the application status. The Business Object updates the application status. ActionForm. bean indicates the state of the model at the session or request level, rather than at the persistent level.

View ):

A view is a JSP file. There is no process logic, no business logic, no model information, and only a tag. Tag is one of the factors that distinguishes Struts from other template technologies such as Velocity.

4. struts2 Architecture

Compared with Struts 1.X, Struts 2 implements the user's business logic Action) and separates the Servlet API. This separation mechanism uses the interceptor or interceptor stack interceptor chain ). Interceptor is one of the core contents of Struts 2.

Struts 2 has multiple built-in interceptor and interceptor stacks formed by multiple interceptors. It intercepts user Web requests and provides richer functions, for example, data type conversion, internationalization, and file upload.

5. Hibernate Architecture

Hibernate is an open-source object relationship ing framework that encapsulates JDBC objects in a lightweight manner, so that Java programmers can use the object programming thinking to manipulate the database as they wish. Hibernate can be used in any situation where JDBC is used. It can be used in Java client programs or Servlet/JSP Web applications. The most revolutionary is that, hibernate can replace CMP in the J2EE architecture of application EJB to fulfill the task of data persistence.

 

Hibernate has five core interfaces: Session, SessionFactory, Transaction, Query, and Configuration. These five core interfaces are used in any development. Through these interfaces, you can not only access persistent objects, but also control transactions. These five core interfaces are described below.

· Session interface: The Session interface is responsible for executing the CRUD operation on the Persistent Object (the CRUD task is to complete the communication with the database, including many common SQL statements .) . However, it should be noted that the Session object is non-thread-safe. At the same time, the Hibernate session is different from the HttpSession In the JSP application. Here, when we use the term session, it actually refers to the session in Hibernate, and later we will call the httsemi sion object a user session.

· SessionFactory interface: The SessionFactory interface is used to initialize Hibernate. It acts as a proxy for the data storage source and is responsible for creating Session objects. The factory model is used here. Note that SessionFactory is not lightweight, because generally, only one SessionFactory is required for a project. When you need to operate multiple databases, you can specify a SessionFactory for each database.

· Configuration interface: the Configuration interface is responsible for configuring and starting Hibernate to create the SessionFactory object. During Hibernate startup, the Configuration class instance first locates the ing document location, reads the Configuration, and then creates the SessionFactory object.

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

· Query and Criteria interfaces: Query and Criteria interfaces are used to perform various database queries. It can be expressed in HQL or SQL statements.

6. J2EE architecture

J2EE is a set of technical architecture completely different from traditional application development. It contains many components, which can simplify and standardize the development and deployment of application systems, thereby enhancing portability, security, and reuse value.

The core of J2EE is a set of technical specifications and guidelines, which contain various components, service architecture and technical layers and have common standards and specifications, so that various platforms that follow the J2EE architecture can, there is good compatibility to solve the problem of incompatibility between the information products used by the enterprise backend in the past, making it difficult for the enterprise to communicate internally or externally.

 

7. Oracle architecture Diagram

Link: http://blog.csdn.net/fanxiaoqing/article/details/7348522

Edit recommendations]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.