Common struts, Hibernate, Spring, Java EE, Ibatis, Oracle and other development framework architecture diagrams and their introduction

Source: Internet
Author: User
Tags aop

Various system architecture diagrams and their introduction

Reproduced please retain the source, the life of a drunken summary.

The following text and architecture diagram are used in my related system design and architecture scheme.

Original source: http://space.itpub.net/6517/viewspace-609654

1.Spring Frame composition

Spring is an open source framework that is created to address the complexities of enterprise application development. One of the main advantages of the framework is its layered architecture, which allows you to choose which components to use while providing an integrated framework for Java EE application development. The functionality of the Spring framework can be used in any Java EE server, and most features are also available in an out-of-management environment. The core point of Spring is to support reusable business and data access objects that are not tied to a particular Java EE service. Such objects can be reused across different Java EE environments (Web or EJB), standalone applications, and test environments.

    • Core container: The core container provides the basic functionality of the Spring framework. The main component of the core container is Beanfactory, which is the implementation of the factory pattern. The beanfactory uses the inversion of control (IOC) pattern 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 contextual information to the spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internationalization, checksum scheduling.
    • Spring AOP: With the configuration management feature, the Spring AOP module directly integrates aspect-oriented programming capabilities into the spring framework. Therefore, it is easy to enable any object managed by the Spring framework to 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.
    • The Spring dao: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 number of exception codes that need to be written (such as opening and closing connections). Spring DAO's JDBC-oriented exception conforms to the common DAO exception hierarchy.
    • The Spring orm:spring Framework inserts several ORM frameworks, providing ORM object-relational tools, including JDO, Hibernate, and IBatis SQL Map. All of these conform to Spring's common transaction and DAO exception hierarchies.

2.ibatis Frame composition

Ibatis is a Java-based persistence layer framework. The persistence layer framework provided by Ibatis includes SQL maps and Data Access Objects (DAO), as well as a Jpetstore instance developed using this framework.

IBATIS: The biggest advantage is that it can effectively control the number of SQL sent, improve the efficiency of data layer execution! It requires programmers to write their own SQL statements, not like Hibernate is completely object-oriented, automated, Ibatis is semi-automatic, through the table and object mapping and manually written SQL statements, can achieve higher query efficiency than hibernate and so on.

Ibatis just encapsulates the data access layer and makes a partial object-relational mapping for us. But the price is that you have to write an XML configuration file, and write a lot of SQL relative to hibernate. Hibernate generates entity classes and basic configuration files directly from the database schema using the tool, and in most cases does not require us to write SQL, which can greatly improve the development efficiency. But these also have a lot of limitations, especially the environmental requirements (database design, object design, teamwork, etc.). Personal feeling Ibatis What's interesting about the project is that it's small, flexible, extensible, encapsulates the data access layer (transactions, caches, exceptions, logs), and provides support for the DAO framework.

With Ibatis we can do the separation of code and SQL, as long as the SQL can solve the problem, Ibatis can help us easier to solve, but also make our project to a framework of the dependence of small (because Ibatis is non-invasive). This will greatly reduce the project risk, reduce the time to solve complex problems, make the maintenance of the project easier.

Ibatis the modification, commissioning, expansion and maintenance of the application will become easy and natural. When we modify, we mainly modify the entity object that represents the model, the SQL in the XML configuration file, and/or the resultmap of the configuration file (many times it is not needed). At the same time, with SQL and code separation, we don't have to look for the SQL that needs to be modified between the StringBuffer append methods of the code. The SQL in the configuration file facilitates our debugging and review of SQL and subsequent SQL reuse.

3.structs1 Frame composition

Struts is an open Source project of the Apache Foundation Jakarta Project, which uses the MVC model to help Java developers develop Web applications using the EE. As with other Java architectures, Struts is an object-oriented design that has the ability to "separate display logic and business logic" from the MVC pattern. The core of the Structs framework is a resilient control layer based on standard technologies such as Java servlets,javabeans,resourcebundles and XML, as well as some class libraries for Jakarta Commons. Struts has a set of mutually collaborative classes (components), Serlvet, and JSP tag lib. The Web application based on struts architecture basically conforms to the design standard of JSP Model2, which can be said to be a kind of change of traditional MVC design pattern.

Struts has its own controller, and incorporates other technologies to implement the model and view layers (views). At the model level, struts can be easily combined with data access techniques, such as JDBC/EJB, and other third-party class libraries such as Hibernate/ibatis, or Object Relational Bridge. In the view layer, struts is able to work with JSPs, including JSTL and JSF, as well as Velocity templates, XSLT and other presentation layer technologies.

Struts supports every professional WEB application, helping to create an extended development environment for your application.

? client browser (client browser)

Each HTTP request from the customer's browser creates an event. The Web container responds with an HTTP response.

? Controller (Controllers)

The controller receives a request from the browser and decides where to send the request. In the case of Struts, the controller is a command design pattern implemented in the servlet. Struts-config.xml file Configuration controller.

? Business logic

The business logic updates the state of the model and helps control the process of the application. In the case of Struts, this is done by the action class as the "thin" wrapper of the actual business logic.

? The state of model (models)

The model represents the state of the application. The business object updates the state of the application. Actionform. The bean represents the state of the model at the session level or at the request level, not at the persistence level. JSP files are read from Actionform using JSP tags. The information for the bean.

? View (views)

A view is a JSP file. There is no process logic, no business logic, no model information--only markup. Markup is one of the factors that makes Struts different from other frameworks, such as Velocity

4.structs2 Frame composition

Struts 2 separates the user business logic (Action) from the Servlet API as opposed to the struts 1.X, which uses an interceptor or interceptor stack (the Interceptor chain). Interceptors are one of the core elements of struts 2.

Struts 2 has multiple interceptors and interceptor stacks (interceptor chains formed by multiple interceptors) that intercept users ' Web requests, providing richer functionality, such as data type conversions, internationalization, file uploads, and more.

5.Hibernate Frame composition

Hibernate is an open-source object-relational mapping framework that provides JDBC with a very lightweight object encapsulation that allows Java programmers to manipulate databases at will using object programming thinking. Hibernate can be applied to any JDBC application, both in Java client applications and in servlet/jsp Web applications, and most revolutionary of all, hibernate can replace CMP in the EE architecture of the EJB application. The task of achieving data persistence.

Hibernate has a total of 5 core interfaces: Session, sessionfactory, Transaction, query, and configuration. These 5 core interfaces will be used in any development. Through these interfaces, you can not only access persistent objects, but also enable transaction control. These five core interfaces are described separately below.

· Session Interface: The session interface is responsible for performing crud operations on persisted objects (the task of crud is to complete the communication with the database, including many common SQL statements. )。 However, it is important to note that the session object is non-thread-safe. At the same time, Hibernate's session differs from the HttpSession in JSP applications. When the term "session" is used, it is actually referring to the session in Hibernate, and later the Httpsesion object is 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. The factory model is used here. It is important to note that Sessionfactory is not lightweight, because in general, a project typically requires only one sessionfactory, and when you need to manipulate multiple databases, you can specify a sessionfactory for each database.

· Config interface: The configuration interface is responsible for configuring and starting Hibernate, creating Sessionfactory objects. During Hibernate startup, the instance of the configuration class first locates the map 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, and developers can also design their own underlying transaction-processing code.

· Query and Criteria interface: query and Criteria interfaces are responsible for executing various database queries. It can be expressed in either the HQL language or the SQL statement.

6.J2EE Frame composition

The Java EE is a completely different technology architecture from traditional application development, including many components that simplify and standardize the development and deployment of application systems, thus improving portability, security, and reuse value.

Java EE Core is a set of technical specifications and guidelines, including various types of components, service architecture and technical level, all have common standards and specifications, so that the different platforms following the Java EE architecture, there is good compatibility, to solve the past enterprise backend use of information products are incompatible with each other, The dilemma that makes it difficult for companies to communicate internally or externally.

7.Oracle Frame composition

Common struts, Hibernate, Spring, Java EE, Ibatis, Oracle and other development framework architecture diagrams and their introduction

Related Article

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.