Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of Spring Core Technology and Product concept [part two]

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

3. Spring Cloud butterfly transformation and rebirth

The upgrade and evolution of Spring framework revolves around the hierarchical architecture, from simple to complex, and then back to simple. If we hadn't experienced the tedious configuration of Spring at first, and then streamlined it step by step, we wouldn't have understood why there was Spring Boot at all. As the saying goes, troubled times make heroes. In the alternating stage of the new era and the old era, the old order that used to rule the world is slowly failing, but the new order has not yet taken shape, and those giants who establish or rely on the old order will be habitually pushed forward, and they habitually look at the world with the old thinking or vision, so they cannot correctly understand the new era, which is the opportunity to give birth to new giants. With the popularity of mobile phones and other intelligent terminals, the original largest development field has changed from enterprise applications to Internet applications, which has also led to a surge in computing, storage and other demand, cloud computing immediately called out. The infrastructure has evolved from traditional to cloud computing, and the application architecture that matches the traditional infrastructure is a single hierarchical architecture, but what is the application architecture that matches cloud computing? The big era needs foresight, otherwise it is easy to be confused.

I remember that during the years from 2013 to 2016, there was a period of confusion in the application development technology stack. Veteran's company originally had a unified internal development framework, which encapsulated, customized and extended Spring to adapt to the company's internal basic platform and common components to meet the development needs of various internal enterprise applications. Enterprise applications are to serve the internal office paperless, automation, the size of users and concurrent visits can be predicted, a single hierarchical architecture is sufficient. However, with the development of the Internet, more and more businesses begin to go online, including marketing, customer service, etc., the number of Internet users is growing, and the difference between the peaks and troughs of concurrent visits is also getting larger and larger. Single hierarchical architecture obviously can not meet the requirements of business development.

At that time, enterprises that were relatively advanced in the Internet field began to feel the stones and cross the river under the business drive. at that time, service-oriented architecture SOA and Web Service,Spring were most good at enterprise application development, but there was some confusion about how to meet the needs of Internet applications, and many new species began to appear in the industry, among which Ali's Dubbo was the most popular. There was once a saying that Dubbo should replace Spring. Web Service is like EJB at that time, too complex and bloated, but in the absence of a better choice, many enterprises have adopted Web Service. Until the emergence of new architecture technologies such as RESTful, and Netflix explored the micro-service architecture, the industry found the magic weapon to deal with the Internet.

Pivotal,Spring, the owner of Netflix, happened to be providing consulting services to Netflix while it was exploring the microservice architecture. When the micro-service architecture is proved to be feasible, Spring will bring Netflix micro-services family bucket Netflix OSS into Spring Cloud, and the components include Eureka, Zuul, Ribbon, Hystrix, Archaius and so on. With the technological advancement and maturity of this solution, as well as countless fans all over the world, Spring has returned to the top position of Java application development framework in the era of cloud computing. Spring Boot reduces the difficulty of the development of a single application, Spring Cloud reduces the difficulty of the development of distributed systems, the combination of strength, invincible.

As Spring Cloud became more and more secure, its ecology began to change. First, Netflix announced that Eureka was closed, and then Netflix announced that Hystrix would stop developing new features. At the same time, Spring Cloud has evolved from relying on ecological partners to provide key components, such as Spring Cloud Gateway, Spring Cloud Config, Spring Cloud LoadBalance and so on.

The role of J2EE in application development is also evolving. At first, applications related to J2EE and Spring will be deployed to the application server, but now with the support of Spring Boot, applications can adopt DevOps and cloud native development mode, and the Servlet container is embedded in the publisher. After Spring 5.x, applications using WebFlux can not rely on any Servlet API, or they can be deployed on servers that are not Servlet containers, such as Netty, etc. Spring is still innovating and evolving. In addition to Spring Framework, it also contains many sub-projects: Spring Boot, Spring Security, Spring Data, Spring Cloud, Spring Batch and so on. At this point, Spring Cloud successfully changed.

4. Spring's product design concept.

The development of Spring is not achieved overnight, first from point to line, and then from line to surface. At first, it only realized the core features such as IoC and AOP, supported single layered architecture, and then standardized the interaction between different systems by Spring Cloud. At the same time, it continued to build a rich and powerful ecosystem. The success of Spring is not only the technical level, but also the conceptual level of product design. The technological leadership is easy to be imitated and plagiarized, but the conceptual gap is difficult to cross.

LEGO, a toy brand from Denmark, a fairy tale kingdom, has developed into a leading brand in the world toy market after more than 80 years, and has become one of the world's top 500th (96th). Its products are popular all over the world because of its unique combination structure, and have been loved and collected by countless children and even adults. The company now produces plastic particles in several basic shapes, starting with making wooden toys and then turning to plastic toys, but the toy market is similar to the clothing market, with different popular styles every year. Lego can't accurately predict toy trends every year, and business is not booming.

Later, when the company passed to the founder's son, a toy dealer suggested that he produce assemblable toys so that players could assemble all kinds of toys, and Lego would never be out of date. Most of the granular molds can be reused. Since then, Lego began to get out of control, products sold all over the world, and players spontaneously formed a variety of communities to exchange experiences, contributing countless wisdom to the development of Lego. But with the rise of electronic toys and games, Lego's experiential toys were hit until players used single-chip microcontrollers, electric motors, sensors and building blocks to build programmable, mobile and remotely controlled robots. Lego is back as a market leader.

The reason for telling the history of the development of Lego is that it has similar reasons with the success of Spring: first, it provides basic components that are simple, lightweight and easy to use, and then provides programmable assembly capabilities. For Lego, it is the standard bump clasp used to connect building blocks, as well as programmable single-chip microcontrollers. For Spring, it is the IOC that controls the assembly process through configurations such as XML, Annotation or Java, as well as standardized assembly auxiliary function AOP. With a wealth of basic components and programmable assembly capabilities, players or users will have the flexibility to use their ingenuity to create all kinds of works.

Compared with the group intelligence of global players or users, the talent that a single company can hire is very limited. Spring's product design concept is open to group intelligence, and its flexibility stimulates the creativity of users. at the same time, it brings together global group wisdom through open source to build a powerful biosphere, which is the secret of its success and long-lasting success. To sum up: simple (basic components), flexible (programmable), ecological (open source), this theory can also be verified on the subversive success of products such as Apple's iPhone.

Typical full Spring Web applications:

Spring middle-tier applications using third-party Web frameworks:

Remote service usage scenario:

4.1Design philosophy of Spring

This is the design philosophy explained in the Spring official documentation. When you learn a development framework, in addition to knowing what it can do, the most important thing is to understand what principles it follows. These are the guiding principles followed by the Spring development framework:

Provide different levels of choice. Spring can help you defer design decisions as much as possible, for example, you can replace persistent storage providers by changing the configuration rather than the code. This guideline also applies to many infrastructure concerns or integration of third-party APIs.

Accommodate a diverse point of view. Spring embraces flexibility, it does not insist on how things should be done, it meets a wide range of application development needs from different dimensions.

Maintain strong backward compatibility. The version upgrade of Spring will avoid destructive changes as far as possible, and it will carefully select the supported versions of JDK and third-party libraries to facilitate the maintenance of Spring applications and libraries.

Focus on the design of API. The APIs,Spring team, which is designed to better reflect the nature of the business and can remain the same in multiple versions and for many years, has invested a lot of thought and time in this matter.

Set higher standards for code quality. The Spring framework is very focused on meaningful, up-to-date, and accurate Javadoc, and it is one of the few projects that can claim that the code is neat and that there are no circular dependencies between packages.

5. Spring's product promotion strategy

In the era of monolithic applications, veteran elder brother's company also has an internal development framework, which is encapsulated and isolated on the basis of Spring, which is equivalent to a layer on the outside of Spring. There are two main reasons for adopting this approach: first, it adapts the company's internal technology platform and extends customized specific functions through encapsulation. Second, Spring is an open source product, and there are many variables in its development. In order to avoid its changes to have a bad impact on the application, we need to isolate the protection layer.

But now in the era of cloud computing, we no longer use this approach. Spring has been developed for nearly 15 years, and the open source mechanism allows global developers to participate in it. Over the years, it has proved to be open enough, and it has become a de facto standard in the industry. Our framework is not only for internal users, but also for external users as a cloud product, so it must be compatible with Spring Cloud in order to take advantage of the existing potential of Spring, otherwise it will become a competitor, just like Ali recently launched Spring Cloud for Alibaba.

Product building block standardization, starting from 3.x, Spring evolved from the original integrated product to multiple components. At first our first impression will be that Spring is a heavyweight family bucket solution, but in fact it is not an all-or-nothing solution, users can choose only a few of these components to build applications.

Solution packages, like fast food chains such as KFC, McDonald's and True Kung Fu, are the inevitable choice to better meet the needs of users as their products continue to be standardized and enriched. It is too difficult to promote the full set, assemble on demand, provide personalized solutions for different user scenarios, reduce the difficulty for users to get on the bus, let users use it first, establish a connection, and facilitate further transformation. Do not pick users, but find ways to solve the problems of different users. This is more in line with the user's perspective, because users do not have an intuitive sense of a large and comprehensive solution, they only care about whether the product can solve the most urgent problems.

High-frequency characteristics drive low-frequency characteristics, and some product features or components are more universal, and the more frequently they are used by users, then these features or components should maintain a low profit margin, or free of charge, and use them to expand the size of the user group. as a result, there is an opportunity to promote those low-frequency and high-moisture features or components. This is actually the Internet thinking, through the free strategy to increase the number of users, and then deep ploughing users, so free is actually the most expensive price.

Through standardization and package, we can make each sub-product develop and operate independently, work to the door, and stimulate creativity and motivation. Soldiers are divided into multiple channels and multiple breakthroughs, and each solution can be promoted separately and share users with each other. At the same time, Spring standardizes the customized extension mechanism, unites all the forces that can be United, and constructs an ecological alliance. We say that architecture design is a design cooperation mechanism, and Spring's excellent architecture design is very helpful to cooperation, so as to break through the tight encirclement. Open source, embracing open source trends, dispels customers' concerns about being locked in by technology.

6. Summary

This paper mainly combs the core technology and product concept of Spring, which can be used as an index reference for learning Spring, and the best learning material is the official help document. These knowledge points are very necessary for an in-depth grasp of Spring. In peacetime, veterans often have to help colleagues analyze positioning technical problems, and it will be more easy to analyze positioning problems with their help. At the same time, the product design concept and operation strategy for veterans to promote the micro-service framework is also very meaningful, how to promote an application development framework from scratch, readers can also consider applying these strategies to other products. Considering that each of us has different work and study conditions and different problems, the content of this article can not cover the problems encountered by everyone. You are welcome to leave messages and questions, and you are also welcome to follow the exchange and interaction of "IT veterans". Thank you!

The index of other articles in this series is as follows: analysis of Spring core technology and product concept (part I)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report