"SSH Advanced path" Struts + Spring + Hibernate advanced Start (i)

Source: Internet
Author: User

long ago, I heard of SSH, at first thought is a thing, the specific content is unknown, always feel high-end atmosphere on the grade, after learning to find, not only on the tall, but also low-key luxury has connotation, after a period of research and study of the basic principles of SSH framework and ideas, finally grounded gas. As a beginner, a little bit of harvest, want to through the form of Bowen and everyone to share, common progress, in the process of updating the blog will inevitably have insufficient knowledge of the place, also please Daniel put forward valuable suggestions, for good advice must be open-minded to accept, seriously study.

This blog post is just an introduction to SSH, a brief introduction to SSH and a general overview of the three frameworks, followed by a detailed description of each part of the content, this series of posts will continue to be updated, please pay attention to my blog post. Here's what we're going to do today:


What is SSH


Officially, SSH is an integrated framework for struts+spring+hibernate, a popular open-source framework for Web applications.

Personal Insight: SSH is not a framework, but rather tightly combined with multiple frameworks (Struts, spring, and hibernate) to build flexible, easy-to-scale, multi-tiered Web applications.


The system of the SSH framework is divided into four layers: the presentation layer, the business logic layer, the data persistence layer, and the Domain module layer (the entity layer).

We illustrate by the following diagram that the relationship between the three frameworks and the content they contain are already detailed, and there is no explanation for this.




Let's take a look at the three frameworks that make up ssh in more detail.


Struts


1. What is struts?

From the simple point of view, struts is the simplest of the three frameworks, which is based on the MVC framework. Using javaservlet/jsp technology, it realizes the application framework of MVC design pattern based on Java eeweb application, which is a concrete implementation of MVC or a specific product of MVC.

2, the core structure of struts


The core of struts is also the core of MVC, and struts is a specific product of MVC.

(1) Model

Consists of action, Actionform, and JavaBean, where actionform is used to encapsulate the parameters requested by the user into a Actionform object , which we can understand as entities, Forwarded by Actionservlet to Action,action to process user requests and return processing results to the interface.

(2) View

This section uses jsp+ a large number of taglib, to achieve the rendering of the page.

(3) Controller

Controller is the core of struts, is responsible for intercepting user requests, by calling model to implement the function of processing user requests.

3. Why use struts?


Using struts as the system's overall infrastructure, responsible for the separation of MVC, separating pages from business logic, using pages to be more flexible, without impacting business logic, simplifying the development of MVC-based Web applications, and thus making development more efficient.


Hibernate


1. What is Hibernate?

Hibernate is an object-relational mapping framework that encapsulates JDBC in a lightweight form, allowing us to manipulate relational databases using object-oriented thinking.

2, Hibernate's core composition


This part of the content we do not do too much explanation, the above map of the explanation is very simple and clear, if still do not understand, you can access the relevant information online.


3. Why hibernate is used?


(1) Hibernate is a lightweight object encapsulation of JDBC, making it easier to deal with relational databases.

(2) Object-oriented, it makes it possible to manipulate relational database with object-orientated thinking, simplifying DAO layer coding and making development more object.

(3) Better transplant, support various databases, replace the database is very simple, do not need to change the code.

(4) Transparent persistence is achieved without the implementation of a third-party framework or interface, without intrusion, and is a lightweight framework.


Spring


1. What is Spring?

In short, spring is a lightweight control inversion (IoC) and aspect-oriented (AOP) container framework.

2. Core composition of Spring



(1) IoC

IOC is the IOC, not the technology, is a design pattern. By means of dependency injection, spring manages and controls the dependencies between objects, avoiding excessive program coupling caused by hard coding.

(2) AoP

A technology that implements the unified maintenance of program functions by means of precompilation and runtime dynamic agent.

(3) Container

The ability to manage the life cycle of objects, the dependencies between objects and objects is a container.


3. Why use Spring?


No spring,struts and Hibernate can run well, I call this pattern "the plank bridge", but with spring,struts and hibernate can better combine together, coordinated work. I call this mode " Sunshine Boulevard ". The core idea of spring is that IOC and aop,spring make the management object more convenient, greatly reduce the coupling degree between components, and realize the decoupling between each layer of software. Spring has many advantages, and we are no longer tired of it.


Summarize


SSH not only realizes the complete separation of the view, controller and model, but also realizes the separation of the business logic layer and the persistence layer, the coupling degree is reduced, the system flexibility is better and the reusability is high. At the same time, the framework provides us with some basic services to make our development more simple and greatly improve the development efficiency.


SSH Advanced Path Struts + Spring + Hibernate advanced Start (i)

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.