The respective roles of the Java three-frame ssh (2)

Source: Internet
Author: User
Tags aop

First, Spring

Spring is a powerful framework that solves many of the problems that are common in the development of Java EE. Spring provides a consistent approach to managing business objects and encourages the good habit of injecting programming to interfaces rather than classes.

The schema base of spring is based on the inversion of control container that uses the JavaBean property. However, this is only part of the complete Picture: Spring is unique in using the IOC container as a complete solution to all architectural layers.

Spring provides a unique data access abstraction, including a simple and efficient JDBC framework, which 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 across a variety of underlying transaction management techniques, 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-to implement your own aspects.

This framework is powerful enough to allow applications to throw away the complexity of EJBS while enjoying the critical services associated with traditional EJBS. Spring also provides a powerful and flexible MVC web framework that can be integrated with IOC containers.

Second, structs

Struts is an MVC framework based on the Sun EE platform, which is implemented mainly by servlet and JSP technology.

Because struts can fully meet the needs of application development, easy-to-use, agile and rapid, over the past year has been a considerable concern.

Struts consolidates Servlets, JSPs, custom tags, and information resources into a single, unified framework that developers use to develop without having to code their own full set of MVC patterns, saving time So struts is a very good application framework.

Third, Hibernate

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 is that hibernate can replace CMP in the EE architecture of the EJB application. The task of achieving data persistence. Fdhibernate can be used to replace CMP in the Java EE architecture of EJB application to accomplish the task of data persistence. Mapping is very simple, is the map of the page, do more practice will be,

Java three frameworks are used to make Wen applications. Struts is primarily responsible for presentation layer display spring uses its IOC and AOP to handle the control business (responsible for database operations) Hibernate is primarily the persistence of data to the database When using the JSP servlet to do Web page development, there is a mapping file with Web. XML, there is 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 content written in the Java file displayed in the browser, is a Web page, so the page name is casually written, random name, whatever you get up is. php. jsp. Do or everything else corresponds to this Java file, the code in this Java file to do what to do, display a word or connect the database or jump to other pages and so on, this Java file to encapsulate the data for security and easy to manage the role. In fact, this Java file compiled is a. Class of a bytecode file, there is not a similar HTML embedded tags and code page file. The difference between him and the JSP file is that the JSP embeds the code in the HTML tag. And the commit name in the action of the servlet or the HTML form in struts corresponds to a Java file, and struts is generally. Do, which is mapped as above.

Today, the mentor came to talk again and asked how the project was going. This month is really a lot of things, before the post-graduate cheerleading game, and then there are so many classes to knot, all to write homework. So this month didn't even start. There is a more important reason is that the project is really boring, not a shot of the technology, the most simple statement, such a code how to get the hand, so learning three frames, but with the teacher a chat, found that learning is indeed some of the eyes, so on the internet to find out what they have learned what is to do, Can you make a breakthrough on your project?

Original: http://christhb.blog.163.com/blog/static/98982492011727114936239/

-----------------------------------------------------------------------------------------------

The role of SSH three
    • The role of struts in the project

Struts plays a major role in the project, as long as the web layer (i.e. the view layer and the control layer) is used
Struts itself is implemented using a typical MVC structure, and after using struts, the project is also an MVC structure that makes the project structure clearer and the division of labor more detailed.
Struts in the project is mainly responsible for the view layer, control layer, in the view layer provides a large number of tag libraries, improve the development of the view layer speed. The control layer uses a central controller (actionsupport) and a configuration file (Struts.xml) to intercept user requests, encapsulate request parameters, and page navigation.

    • The role of spring in the project

Spring is a full-fledged integration framework that integrates hibernate and struts in the project to solve the coupling problem between layers and layers.
Spring's role spans the entire middle tier, seamlessly consolidating the web layer, service layer, DAO layer, and PO.
Spring's IOC implements dependency injection between components, the upper frame does not penetrate the lower component, improves the portability and reusability of the components, makes the program more flexible, the upper frame does not depend on the implementation but relies on the abstraction (delegate interface), so that the implementation class changes do not affect the upper component, Resolves maintenance or upgrade difficulties caused by coupling between layers and layers
SPRINGAOP is the aspect-oriented programming, realizes the transaction processing, the log service and so on the business independent system service, realizes the plug-in programming.

    • The role of hibernate in the project

Hibernate is applied to the data persistence layer and is a lightweight package for JDBC. is an object, relational mapping tool, which provides a mapping from Java class to a data table, and also provides mechanisms such as data query and recovery, which greatly reduces the complexity of data access. The direct operation of the database is converted to the operation of the persisted object.
The main role in the project is 1, the solution is dependent on the database, that is, after using Hibernate, later change the database does not need to change the code, because hibernate will be based on the database dialect to generate the corresponding SQL statement; 2 is a lightweight package for JDBC, simplifying the code for persistence layer and improve the speed of development.

Original: http://www.cnblogs.com/bettertanme/p/32788

The respective roles of the Java three-frame ssh (2)

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.