The bitter history of code farming! After five years of advanced Java architect road, looking back on the journey along the way!

1 Introduction

The brethren who are engaged in Java definitely want to reach a higher level, solve more problems with less code, and prepare for possible inheritance and maintenance with a clearer structure. Think about it when I crossed the river by feeling the stones, and I have seen the learning routes introduced by many people. I have gained some gains in the past ten years. Now I summarize an article based on my own experience for the brothers' reference.

2. Make good use of the framework you are using

In the team that has joined, use the framework that the team has selected in collaboration with everyone. Regardless of whether the framework is good or bad, and its characteristics, there must be some reason to choose it. And the framework that can be popular in the industry for a long time must have its advantages.

The first step in using the framework is to be familiar. It may be possible to realize new functions or modify existing functions by copying and modifying the code of the predecessors, and gradually become familiar with the use of the framework.

The second step is to understand in depth, after knowing how to use it, mastering its laws according to usage and phenomena, and forming a guess about the internal structure and operating mechanism of the framework, most of which are definitely correct.

The third step is to use it well. After having a certain sense of the internal mechanism of the framework, gradually summarize and adopt better practices, and adopt more concise, clearer or more efficient methods to achieve the same purpose. You can refer to the framework's "best practice" documents (such as the last chapter of the Hibernate reference manual). For those who do not provide "best practice" documents, you can sum up some experience and continue to improve.

There is no absolute best practice, only the best practice adapted to a certain scenario, and a better implementation suitable for most occasions. ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? The ability to choose different modes according to the scene is a sign of improved level.

3. Understand standard libraries, enterprise-level technologies and open source projects

The existing accumulation in the Java world is already very rich. When a certain problem feels that it is a common problem, it is very likely that there are ready-made standard class libraries or open source projects waiting there. A good grasp of standard libraries and open source projects can reduce the workload and make the code structure clear and easy to understand. Enterprise-level technology refers to the technology in the JavaEE platform, most of which are standards extracted from existing accumulations. For example, JPA is largely derived from Hibernate. The use of enterprise-level technology is very beneficial to the standardization of procedures.

The understanding of standard libraries and open source projects is in no particular order. They can be cross-cutting. You can learn whichever you use. You can also use your spare time to choose what you like to study, study, and do experiments.

3.1. Standard Class Library

From the documentation that comes with Java, you can see the list of standard class libraries (and platform tools) and their relationships. The following picture is the hierarchical relationship diagram:

Pick the points you are interested in to learn more about it.

At first glance, there is a lot of content, but in fact many of them may have already been used. For example, JDBC should have been used by every Java programmer before he was in the world. JNDI should also be something that must be contacted when doing WEB projects. Maybe it's just a few of the APIs, but everything is the three steps of understanding, proficiency, and proficiency. If you understand, it will not be far behind.

Among them, regular expressions, XML processing, applet, concurrency (multithreading), network, IO, graphics are more practical functions, you can start with them. The local interface (JNI), management extension (JMX), reflection, etc. can be used in more advanced occasions. After the meeting, you can provide solutions for more scenarios.

3.2. Enterprise and Technology

Including JavaMail, JMS, EJB, JPA, JSF, web service, etc., the specific list can be found on the official website of JavaEE technology. These techniques are not esoteric to use, and even simpler than standard libraries.

3.3. Open source projects

Frameworks are generally open source projects, and currently there is no organization with the most open source projects than Apache. You can learn open source projects through your needs. For example, if you need to process Excel documents, then learn to use POI; if you want to use web services, you can see CXF; if you need string processing, you can see if it is implemented in Commons Lang; if you need IO operations, you can see See if it is implemented in Commons IO.

In addition to Apache, there are many open source organizations such as eclipse, springsource, and Jboss that provide a lot of free goods. If you have time, it is a good way to learn more. "Gentlemen are not different in nature, and they are also good at deceiving things"-the powerful guys don't necessarily write everything by themselves, but often use a combination of various artifacts.

By the way, many open source projects use relatively rare English words or self-made words as names. When encountering them, it is best to go to the official website to determine its pronunciation. Many people read Struts (originally: swagger) as Structs, which is obviously confused with struct (structure), which sounds really amateurish. And PostgreSQL should be read as postgres-QL, not postgre-SQL, please respect the original intention of the author. Debian should be pronounced "Daiboian", which is a combination of the author's and his wife's names. It is too sorry to read "stool". Don't read "excellent pattern" on Ubuntu.

4. Write better programs

4.1. Code format is neat and elegant

Try to follow the code format suggestions on the official website and make good use of the automatic formatting function of the development tool (Eclipse).

Complicated conditions and loop nesting are refined into methods, and the method names are meaningful, so that future generations look at the program as if they read straight English sentences. Pursue code self-comment. Please pay attention to try not to use pinyin as much as possible, especially the interface between modules (it is better to use a small range within the module). The mixed use of English words and pinyin will make future generations faint. Nowadays, electronic dictionaries have a wide variety and are easy to use. Make good use of them to make the code elegant and at the same time you can recognize a few more words.

4.2. Efficient code content

After using a lot of frameworks and open source projects and writing a lot of programs by yourself, you can start to think about practicing the content of "Effective Java", when and where and how to use appropriate technologies and mechanisms.

5. Understand the model through standard libraries, enterprise-level technologies and open source projects

When it comes to patterns, the first thing you think of is "design patterns." Many beginners have read the book "Design Patterns" in order to make progress. However, according to my experience, I didn’t understand them at the time. I didn’t know why those patterns existed. Know when you can use them. In fact, the so-called "mode" is just the idiom of the predecessors, which is considered to be easy to use and widely circulated by later generations. All the code of the predecessor is copied and changed and used. Such code can actually be said to be the realization of a certain "pattern".

With the use of standard libraries, enterprise-level technologies, and some open source projects, the sense of pattern will be established in the mind. These libraries, technologies, and projects themselves have implemented many patterns, and their use is also a pattern. It's just that the latter is often referred to as actual combat, and it does not appear as a "model" in publications.

"Mode" in addition to "Design Patterns" including "Enterprise Application Architecture Mode", "J2EE Core Mode", there may be more others. Standard libraries and open source projects (including many popular frameworks) have outstanding applications for design flexibility, convenience, and elegance.

Spring is the realization of the factory pattern. JDBC and JMS are the realization of the abstract factory method pattern.

In addition to the well-known MVC, Struts actually implements several of the J2EE core patterns.

Hibernate uses the Proxy mode internally, and its overall existence is the realization of the "table data entry" in the "Enterprise Application Architecture Mode". The CMB in the old EJB2.0 is more like an implementation of "row data entry".

These patterns are learned directly as concepts. Without practical experience, I don’t know why they exist and how to use them, just like I did at the beginning.

If you use more ready-made products, you will feel it. Feel the convenience brought by them, and compare the similar functions among them, you can see the existence of various modes and their excellence.

6. Understand the true meaning of object-oriented

After understanding the patterns, you will find that the foundation for realizing these patterns is the encapsulation and polymorphism provided by object-oriented. This is also the meaning of the emergence of object-oriented.

The eight object-oriented principles are introduced in "Agile Software Development-Principles, Patterns and Practices". Among them, I value the "single responsibility" principle. This principle is very helpful when dividing modules, and its thinking can even extend to the organization. On the construction of the structure.

7. Outlook-Architect

The architect is a team leader who needs to not only control the whole but also need to understand the local bottlenecks and provide solutions based on specific business scenarios. An architect needs enough imagination to expand various target requirements in different dimensions and provide a more comprehensive list of requirements for target customers.

Architects play a very important role in the entire process of software development.

Obtaining method: Follow me and add VX: MXW5308 to obtain resources for free. Remember to get it after paying attention.

With the above steps, it should be able to exist as a qualified designer. If you want to be an architect, a trainer once told us: "Learn the Linux kernel."

The big steps are: look at the 0.01 version to understand its structure, look at the 0.10 version to understand its progress, look at the 0.12 version to understand its improvement, and look at the latest version to understand its current situation.

The learning method is to use UML tools to reverse-engineer the downloaded Linux kernel source files. From the obtained class diagram, you can see the module dependencies. The module with the highest degree is the core of the system. From this module, look at it. How to schedule other modules, and then see how each module implements its own functions.

Advanced architect diagram

1. Read the source code

Reading and analyzing source code is the most basic code ability of programmers, and it is also the foundation of code farmers. Learning the classic design ideas and common design patterns used in classic source code can help you understand how Daniel writes code, so as to absorb big data. Niu's code skills. In Alibaba interviews, the underlying principles of frameworks such as MyBatis and Spring are often asked

Some experience and career planning of five-year Java programmer advanced architect

Open source framework analysis

2. Distributed architecture

Alibaba has many large teams. There are many small teams in this large team. After the small teams, they do different business. If you want to become a universal player among the first-line Internet companies, there are many in the most mainstream distributed architecture. Knowledge must be understood and learned. And during the Alibaba interview process, the interviewer will ask questions about actual application scenarios: such as microservices, user volume, concurrency, business complexity, and scalability, etc. I won’t go into details here. This dick provides a learning idea of ​​a distributed architecture and is also a system that I am currently learning:

Some experience and career planning of five-year Java programmer advanced architect

High-performance architecture topics

3. Microservice architecture

Microservices is one of the hottest topics in Internet architecture technology, and it is also the direction that Bendi is currently studying and researching. During the Alibaba interview, the interviewer rarely asks questions about microservices. But as a developer, a programmer with technical dreams, the microservice architecture is the mainstream technology that must be understood now. The editor has developed a microservice technology learning plan for himself:

Some experience and career planning of five-year Java programmer advanced architect

Microservice architecture topic

4. Concurrent programming

Concurrent programming is almost a must-question for all Internet companies in interviews. Concurrent programming is one of the most important skills for Java programmers, and one of the most difficult skills to master. It requires programmers to have a deep understanding of the operating principles of the lowest level of the computer, and at the same time requires programmers to have clear logic and careful thinking, so that they can write efficient, safe, and reliable multi-threaded concurrent programs. At present, there is no systematic and comprehensive study syllabus for concurrent programming on the Internet. I have collected a lot of information and summed up a most comprehensive study syllabus:

Some experience and career planning of five-year Java programmer advanced architect

Concurrent programming

5. Performance optimization

Performance has always been a headache for programmers. When the system architecture becomes complex and large, the performance will drop. Especially the first-line Internet companies like Alibaba pay the most attention. Therefore, if you want to enter Alibaba, performance optimization must be a part of in-depth learning and understanding. Although the performance optimization is not an expert, you can confidently say that you are proficient (note: you must not write proficient xxxx on your resume, or the interviewer will stun you. Fortunately, this dick is still confident)

Some experience and career planning of five-year Java programmer advanced architect

Performance optimization

6. Design patterns

Design pattern (Design pattern) is a set of code design experience that has been used repeatedly, most people know, classified and cataloged. The use of design patterns is to reusable code, make it easier for others to understand, and ensure code reliability. There is no doubt that design patterns are mutually beneficial to others and systems. Design patterns make code preparation truly engineering. Design patterns are the cornerstone of software engineering, just like the bricks of a building. The reasonable use of design patterns in the project can perfectly solve many problems. Each pattern has a corresponding principle to correspond to it now. Each pattern describes a recurring problem around us, and the core of the problem. Solution, which is why it can be widely used.

Some experience and career planning of five-year Java programmer advanced architect

Design Patterns

This structure diagram was drawn by me. It is not difficult to master the above skills with a monthly salary of 30,000 yuan. It is really not easy to master all these technologies. So I sorted out these technologies, and I specially found a few friends to record some architecture technology videos. These friends have a certain reputation in the circle, and they used to work as architects in first-line Internet companies. These materials have been sorted out and are now free to share with everyone.

Some experience and career planning of five-year Java programmer advanced architect

 

Some experience and career planning of five-year Java programmer advanced architect

Partial data screenshot

Obtaining method: Follow me and add VX: MXW5308 to obtain resources for free. Remember to get it after paying attention.

8. Conclusion

These steps do not have strict boundaries, and can be carried out interspersedly and iteratively.

Learning is a process that diverges first and then converges. At first it seemed to be facing a fan shape, the more you walked out, the more you would not know, and the more you need to learn. But later you will find that the things you have learned have many similarities, you can quickly understand the new things, and you can even discover that some things are just old wine in a new bottle. Just look at it.

"Fools perceive differences, wise men perceive similarities." Fools see things differently and find the world difficult to grasp, while wise men are good at seeing the commonalities (laws) between things in order to get twice the result with half the effort. Since programmers can do it, don't think you are a fool.

Guess you like

Origin blog.csdn.net/weixin_45132238/article/details/114084239