Home >Java >javaTutorial >What is the most commonly used framework in Java web?

What is the most commonly used framework in Java web?

不言
不言forward
2019-03-07 16:10:522526browse

The content of this article is about what is the most commonly used framework in Java web? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Java is open source and has many frameworks. These frameworks can solve specific problems, improve development efficiency, and simplify our code complexity. Now, in addition to many mainstream frameworks that are commonly used by everyone, many companies have developed their own The business will customize some of the company's internal frameworks, but as learners we must first understand what frameworks Javaweb needs to learn.

Before answering this question, we must first look at the scale of our project. For single-application projects with a smaller "volume", the frameworks learned and used are still different from distributed projects that need to process massive amounts of data and high concurrency. of.

For single application projects with smaller "volume":

ORM type framework, many Java web programs need to use relationships The database is used for data persistence, so for this kind of framework that requires database operations, that is, the ORM framework that encapsulates JDBC, you need to learn it. Currently, the more popular one is the SQL-based mybatis framework, which is a lightweight The ORM framework is relatively easy to learn and use, and the same type is the Hibernate framework.

MVC framework, MVC logically divides the program into the view layer, the control layer, and the model layer. Each layer performs its own duties, and there is a relationship of mutual calls rather than interdependence. This kind of The model can adapt well to changes in requirements and software upgrades. The most widely used MVC framework at present is the spring MVC framework. This framework has clear role division, powerful and direct configuration methods, efficient binding and verification, and many other advantages. The earlier Struts2 framework is also an MVC framework.

Spring framework, in fact, many Java practitioners cannot avoid Spring. The Spring family has many "tools". It is a huge progress for programming thinking to change from process-oriented to object-oriented. However, as programs become more and more Complex, there are more and more objects, and efficient "management" and application of these objects are becoming more and more important. Spring's IoC is to hand over the creation and "management" of objects to the Spring container to achieve inversion of control, and at the same time Provides various methods of injecting values ​​(DI), which greatly improves and simplifies our work. This is spring's IoC/DI that JavaWeb needs to learn; when the business of our program is more complex, in addition to completing the core functions, we also need Complete injection exception handling, logging, transaction processing and other conventional functions. These conventional operations are relatively energy-consuming. SpringAOP (aspect-oriented programming) solves this problem.

Javaweb needs to learn some front-end frameworks, especially if the data interface mentioned in the question has been written, or there is a simple backend, the front-end framework jQuery must be learned, if the project is based on efficiency considerations , you need to separate the front and back ends, you can learn frameworks such as vue.

For distributed projects with massive data and high concurrency, The characteristic of this type of project is the large amount of data that needs to be processed as mentioned above, such as the Double Eleven Alibaba needs to process Order data, such as 12306 ticket grabs, etc.

Redis, a caching database framework that improves query efficiency. This framework can also be used in a single application to improve data reading efficiency. First, store the data from the relational database into the cache through Redis, and then read it from the cache. The speed of retrieving data is much higher than reading directly from the hard disk. In addition, Redis can also configure master-slave servers in a cluster, which is very convenient to use. The same type of data is also memcached framework;

In distributed Among them, load balancing in service clusters is particularly important. Nginx is a high-performance HTTP and reverse proxy service framework that supports multiple load balancing algorithms;

Message queue framework: RabbitMQ, ActiveMQ, RocketMQ, etc., in In the e-commerce system, after the order is settled, operations such as changing points need to be performed. The amount of these operations is very large. It is obviously not feasible to notify the user of successful settlement after the point change is completed. At this time, the change operation of points is left to message queue to complete.

Search framework, in order to improve the efficiency of search, create search index library and Chinese search word segmentation, you can use the solr framework, the same type of ElasticSearch

distributed files used for file use System framework Fastdfs

Spring boot framework simplifies the complex configuration of spring and provides Thymeleaf templates. Many microservices are based on Springboot;

Microservice framework splits the application into several After being served individually, it is well suited for high concurrency and massive data processing, but the management of microservices is also very important. Currently, the frameworks based on service registration and service monitoring include Dubbo zookeeper and SpringCloud, which include SpringCloud Eureka, SpringCloud Ribbon, SpringCloud Feign, SpringCloudHystrix, SpringCloudZuul, SpringCloud Config, SpringCloud ZipKin, SpringCloud Sleuth, etc.;

Other frameworks, there are many frameworks based on project-specific requirements, such as the log4j framework for logging, authentication and Shiro framework for authorization, Activite framework for workflow processing, etc.

To summarize: the best way to learn the framework is to apply it in actual projects. This can have a good learning effect on the principles and application processes of the framework. If you simply do some simple demos, there are many applications of the framework. The learning of scenarios, optimization, precautions, etc. is incomplete.

The above is the detailed content of What is the most commonly used framework in Java web?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete