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 will use their own methods for their own business. Define some internal frameworks within the company, but as learners we must first understand what frameworks Javaweb needs to learn.
For single application projects with smaller "volume":
ORM-type framework, many Java web programs It is necessary to use a relational database for data persistence, so this kind of framework that requires database operations, that is, the ORM framework that encapsulates JDBC, needs to be learned. Currently, the more popular one is the SQL-based mybatis framework, which is A lightweight ORM framework that is easier to learn and use. The same type of framework is Hibernate.
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.
The above is the detailed content of What framework is popular for java now?. For more information, please follow other related articles on the PHP Chinese website!