A brief talk on Java three frame and application _java

Source: Internet
Author: User

Preface: For a programmer, especially the programmer developed on the Java Web side, there are three broad frameworks: Struts+hibernate+spring must be well mastered, so here's the basic concepts and principles of the three main Java frameworks.

Java three major frameworks

One, Spring Spring is a powerful framework for solving many of the problems that are common in Java EE development.

Spring provides a consistent approach to managing business objects and encourages the injection of a good habit of programming interfaces rather than class programming. The schema base of spring is based on the inversion control container that uses the JavaBean property. However, this is only part of the full picture: Spring is unique in using the IOC container as a complete solution to build attention to all architectural layers.
Spring provides a unique data access abstraction, including a simple and efficient JDBC framework that greatly improves efficiency and reduces possible errors. Spring's data Access architecture also integrates hibernate and other O/R mapping solutions. Spring also provides a unique transaction management abstraction that provides a consistent programming model for a variety of underlying transaction management technologies, such as JTA or JDBC transactions. Spring provides an AOP framework written in the standard Java language that provides POJOs with declarative transaction management and other enterprise transactions--If you need it--and you can implement your own aspects. The framework is strong enough to allow applications to throw away the complexities of EJB while enjoying the key services associated with traditional EJBS. Spring also provides a powerful and flexible MVC web framework that can be integrated with the IOC container.

Second, STRUCTS struts is an MVC framework based on Sun Java platform, which is mainly implemented by servlet and JSP technology.

Because struts can fully meet the needs of application development, easy to use, agile and rapid, in the past year has been a considerable concern. Struts consolidates the servlet, JSP, custom tags, and information resources into a unified framework that developers use to develop without coding themselves to implement a full set of MVC patterns, saving time, So struts is a very good application framework.

Third, Hibernate Hibernate is an open source object relationship mapping framework, which has a very lightweight object encapsulation of JDBC, so that Java programmers can use object programming thinking to manipulate the database.

Hibernate can be applied to any use of JDBC, either in Java client programs or in servlet/jsp Web applications, and, most of all, hibernate can replace CMP in an EJB-ee architecture, Complete the task of data persistence. , hibernate can replace CMP in the Java EE architecture of EJB application to complete the task of data persistence.

Java has three broad frameworks for Web applications.

Struts is primarily responsible for presentation layer display spring leverages its IOC and AOP to handle the control business (responsible for the operation of the database)
Hibernate is mainly the persistence of data to the database in the JSP with the Servlet Web page development when there is a web.xml mapping file, which has a mapping tag is used to do file mapping. When you enter the URL address in the browser, the file will be based on the name you write to a Java file, according to the contents of the Java file to be written in the browser, is a Web page, so the name of the Web page is casually written, casually up the name, no matter what you up to. php. jsp. Do or anything else corresponds to this Java file, the Java file in the code to do what it does, display a sentence or connect to the database or jump to other pages, etc., this Java file to encapsulate data for security and easy to manage the role. In fact, this Java file compiled is a byte-code file of. class, and there is not a Web page file like HTML embedded tags and code. The difference between him and the JSP file is that JSP embeds the code into the HTML tag. And the submission name in the action of the servlet or the HTML form in struts corresponds to a Java file, and struts is generally. Do, as the above is mapped.

Summary: In simple terms:

Struts is the Web development framework responsible for form submission (equivalent to computer graphics card)
Hibernate is responsible for the operation of the database (equivalent to the computer CPU)
Spring is the equivalent of a motherboard (assembling the video card and CPU)

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.