Home >Java >javaTutorial >What are the functions of each java framework?
What are the respective functions of the three major JAVA frameworks Struts, hibernate and spring?
struts is mainly responsible for the display of the presentation layer, and spring uses its IOC and AOP to handle the control business (responsible for the operation of the database) , hibernate's main function is to persist data to the database.
1. Spring is a powerful framework that solves many common problems in J2EE development.
Spring provides a consistent way to manage business objects and encourages the good habit of programming interfaces rather than classes. Professional teachers from Optics Valley Campus pointed out that the architectural foundation of Spring is based on the Inversion of Control container using JavaBean properties. However, this is only part of the complete picture: Spring is unique in using IoC containers as a complete solution that focuses on all architectural layers.
Spring provides the only data access abstraction, including a simple and efficient JDBC framework, greatly improving efficiency and reducing possible errors. Spring's data access architecture also integrates Hibernate and other O/R mapping solutions. Spring also provides the only transaction management abstraction that can provide a consistent programming model across various underlying transaction management technologies, such as JTA or JDBC transactions. Spring provides an AOP framework written in the standard Java language, which provides declarative transaction management and other enterprise affairs for POJOs - and if you need - you can also implement your own aspects. This framework is powerful enough to enable applications to put aside the complexity of EJB while enjoying the key services associated with traditional EJB. Spring also provides a powerful and flexible MVC Web framework that can be integrated with IoC containers.
2. Speaking of the Struts framework, it is an MVC framework based on the Sun J2EE platform.
It is mainly implemented using Servlet and JSP technologies. Because Struts can fully meet the needs of application development, is simple and easy to use, agile and fast, it has attracted much attention in the past year. Struts integrates Servlets, JSP, custom tags and message resources into a unified framework. When developers use it for development, they no longer need to code themselves to implement a full set of MVC patterns, which greatly saves time, so Struts It is a very good application framework.
3. Hibernate is an open source object-relational mapping framework.
It implements a very lightweight object encapsulation of JDBC, allowing Java programmers to use 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 in Servlet/JSP Web applications. The most revolutionary thing is that Hibernate can replace CMP in the J2EE architecture that uses EJB. , complete the important task of data persistence.
The above is the detailed content of What are the functions of each java framework?. For more information, please follow other related articles on the PHP Chinese website!