Author: Xiao Fu Ge blog: Bugstack.cn – original series of special articles

Precipitation, share, grow, let yourself and others can gain something! 😄

One, foreword

What architect hasn't built a wheel?

Have you ever thought of such a thing? Is the ability first in the arrangement of positions, or the arrangement of positions first in learning? 🤬? Use the back door! Get out!

Just like the school entrance exam, taekwondo exam, and promotion exam, a job is given to a person who is qualified for the next level first. So, architects start building wheels as programmers, but they can build better wheels as architects.

Given the urgency of actual business development, you won’t be allowed to build wheels. But building a wheel is almost every programmer’s best way to break through technical bottlenecks. Never give yourself an excuse not to study because of a sentence, do not repeat the wheel!

2. The wheel I made

I might be obsessed with building wheels!

Fans who know little fu ge may know that my first job was to write C# for two years, but in order not to put down the Java I wrote, I used Java language to write all the projects I could access in Java after work, including; Serial code printer service, repeater docking, PLC data acquisition and so on.

Wait until the official entry into the Internet, like a new door opened for me, this can access to the knowledge too niao sex, disk it! Here, look at the wheel I made.

1. RPC communication component

  • Article: Handwriting RPC Framework Chapter 3 “RPC Middleware”
  • Source: github.com/fuzhengwei/…
  • Difficulty: ⭐ ⭐ ⭐
  • At the beginning of 2015, WHEN I entered the Internet, I was surprised to find that RPC could still be used for communication between the two projects. Before, the company still used HTTP or WebService, so this part of knowledge brought me a great shock. In order to understand it more clearly, I found some source code in Git, such as Dubbo and gRPC, for study. Learn to learn, began to do their own implementation once, the process of practice learned a lot of knowledge, including; Develop middleware with Spring, custom configurations, master definition annotations, section interception, Netty communications, codecs, traffic shaping, and more. These knowledge also laid a good foundation for my subsequent development of other middleware.

2. Write a JVM VM

  • Article: Implementing a JVM virtual machine in Java
  • Source: github.com/fuzhengwei/…
  • Difficulty: ⭐ ⭐ ⭐ ⭐ ⭐
  • This is a wheel that doesn’t work, and at the same time it might be a little bit sloppy 🤔, it took a month to write hundreds of thousands of lines of code to run a few simple HelloWorld. But, because I don’t want to listen to some theoretical words blowing my coding career, and I don’t want to read a few books that can’t be put into practice and feel like I’ve learned. Therefore, I was willing to invest a lot of time in practice. Although I could not completely program a JVM that could be used in production, I understood the basic functions of THE JVM through such learning. Searching and parsing classes, bytecode instruction sets, run-time data areas, virtual machine stacks, stack pins, local variable tables, operand stacks, registers, and so on make Java code run step by step.

3. Distributed task middleware based on SpringBoot

  • Article: Development of DcsSchedule distributed task middleware based on SpringBoot
  • Source: github.com/fuzhengwei/…
  • Difficulty: ⭐ ⭐ ⭐
  • What kind of wheel is it? To put it simply, its function is similar to XXL-job. The problem to be solved by the component is that scheduled tasks can be assigned to different machines for execution. At the same time, it uses ZooKeeper as the registry to expand into a distributed task scheduling system. Access mode Easy to access, unified control of start, stop, downtime, and disaster recovery. And can automatically detect; Number of deployments, total number of tasks, number of successes, number of failures, and execution time.

Service governance middleware

  • Article: Unified whitelist verification for service governance middleware
  • Source: github.com/fuzhengwei/…
  • Difficulty: ⭐ ⭐ ⭐
  • What is service governance? In fact, service governance includes more content, such as; From the deployment level, management level, application level, gateway level, and so on, the service governance here refers to the application level. To put it simply, for example, you have many service systems, and each external layer of the service needs to be whitelisted. What then? It is unlikely that every system will develop similar functionality repeatedly, and it will be difficult to manage. Therefore, we hope to extract the universal core functions of non-business logic from the business system and develop them into unified business components to help decouple services and make the business system care more about business process development. So that’s one of the roles of service governance.

5. Netty imitates wechat on the desktop

  • Netty+JavaFx combat: imitation desktop version of wechat chat
  • Source: github.com/fuzhengwei/…
  • Difficulty: ⭐ ⭐ ⭐ ⭐
  • In this project, the author Xiao Fuge uses JavaFx, Netty4.x, SpringBoot, Mysql and other technology stacks and prefers DDD domain driver design to build the imitation desktop version oF wechat to achieve the core communication functions.

6. And lots of made wheels

  1. Database sub-library sub-table routing middleware
  2. Redis cache read and write engine middleware
  3. ES + Ibatis uses middleware in combination
  4. Full-link business process monitoring

In addition, there are many other wheels that were made, and the others are not to be listed. Of course I don’t just make wheels, I make all kinds of gadgets, even a Hashed routing calculator written by JS. In short, I may have gone too far in building wheels because of my obsession with 🧐!

Three, make wheels promotion pay?

Making wheels doesn't necessarily mean you'll get a promotion or a raise. If you do it for the first time, you might get your pay docked.

If it is used in the business system to build wheels, different from CRUD, often need to understand Spring or SpringBoot part of the source code, as well as dynamic proxy and reflection knowledge. And the design and implementation should also be considered very comprehensive, otherwise the accident is not just a system, but all the systems that use your wheel need to be upgraded with you online. So, making wheels doesn’t necessarily mean getting a raise or promotion!

However, building a wheel will allow you to grow your technical stack quite comprehensively, and may allow you to break through existing technical bottlenecks at some stage. Because to build wheels you need to learn from other people’s wheels, component source code, expanded stack of technology and more comprehensive thinking 🤔.

Finally, you need to build wheels that are proven and scalable to meet the needs of the business, and this may be a job other than your normal business systems development. Whether you can withstand this test determines how much knowledge you can gain. And this knowledge that others do not master is your appreciation of the chip! It’s your ability to stay and your ability to go out!

Are you opposed to the wheel?

Do not repeat the wheel, do not repeat the wheel, do not repeat the wheel

There are many times when you hear these words and put out a small fire in your heart. In fact, this sentence is not necessarily wrong from some time, because the development of a project to the online, need to evaluate the time cost, project quality, reliability, no one dare to use a new function without verification, also dare not let you practice.

Of course, sometimes the wheel we build is not necessarily repetitive, it may be innovative. But the wheel stage should not be the start of a new project, but at least it should be written, validated, and put into production before you can build it. For the current development, if it’s urgent, it’s best to play it safe and learn more from the project. And summarize if you use your wheel, how long can this wheel support, whether it needs to be expanded, and whether there will be problems.

All of these learning, summary, application, and ultimately can pave the way for the growth of your technology stack. Don’t give up because others oppose you. Don’t be stubborn and stubborn. Grow and learn with ease. A prepared person will always be helpful when necessary 😎!

Five, the summary

  • No word can say whether it is right or wrong to build a wheel, even one that already exists. What about your purpose of learning? Are you oriented toward coming up with a better solution? So, if you want to build it, just be sure to prove it in use!
  • Building wheels can teach you a lot about things other than business systems development. This knowledge can expand your tech stack, scan out some of the technical blind spots, and prepare you for a higher salary when you’re ready for a promotion or job interview.
  • Want to make the wheel to learn to read the source code, learn to transfer technology, learn data structure, learning algorithm, learning design mode, must be the first to improve the technical vision, in order to let oneself have the idea of making the wheel, rather than hard.

Six, series recommendation

  • Mybatis interface does not implement the class why can perform add, delete, change, check
  • Spring timing task Quartz execution process source code interpretation
  • Based on JDBC to achieve a Demo version of Mybatis
  • Zha? Your IDEA has expired. Add a Jar package to crack, why?
  • Handwriting myBait-Spring core features