Sorting out the knowledge of Java Web Architecture — an interview with ALI

"The best time for you to learn a technology is three years ago, followed by now." That never worked. After this interview, I feel that I need to sort out java web related materials in order to improve or quickly adapt to the new job I may face.

First, let's talk about what Java Web needs to master. Here is the collection of some knowledge points. I won't give a detailed description for the time being. You are welcome to add and correct.

I won't talk about the Java language. The first is the structure and working principle of the JVM. More important are JAVA memory model, various GC algorithms, loading principle of classloader, etc. I know some things at the bottom, so I don't have much trouble. In fact, the process of program compilation and linking and the processing of binary files are still worth studying. JVM monitoring and tuning. As a developer, you don't need to be very familiar with JVM tuning methods, but if you have the ability of JVM monitoring and tuning, you will know the running status of the program like the back of your hand and be much more sensitive to problem location. Java multithreading. Understanding of thread safety and how to avoid inconsistency caused by multithreading in their own programs. I/O。 Bio / NiO is often mentioned in Java, that is, blocking I / O and non blocking I / O. in fact, it is not difficult to understand. Combined with the implementation principles of synchronous I / O and asynchronous I / O in Linux, they are basically interlinked. What are the problems solved by each I / O method, and why epoll is used.

Servlet is a java program running on the server. Generally, java server applications that implement their own inherit from the httpservlet class, and then implement their own init | doget | dopost | service method. The life cycle of a servlet starts from its loading. First, it performs an initialization, calls the init method, and then runs its own service. When the life cycle ends, it calls the destroy method to reclaim resources and end the service. Of course, it is not enough to only understand the principle, but also the practical ability. Anyone can write simple code in the IDE. However, it also needs something else to make a program run. Here I refer to the servlet container. There are many servlet containers. Tomcat is commonly used as an example. After Tomcat is installed, Tomcat lib must be included in development. IDE really spoils many people. How to organize directories, how to compile and deploy programs are shielded by ide. If you want to have a thorough understanding of the whole, it is recommended to start with the command. For details, please refer to servlet and JSP core programming.

The number of frameworks used in Java Web development is appalling, and the problems caused by the update of versions are endless. However, this is also the result of the continuous evolution of web technology, either choose to accept or lead the rhythm.

Spring is a powerful and "lightweight" java development framework. It is quoted because it doesn't feel so lightweight. The main purpose of spring is to simplify Java application development, replace hard coding programming with configuration, and decouple modules. Its architecture is shown in the figure below. It includes data access, remote communication, AOP, core container and so on. Figure 1 spring architecture the core of spring mainly includes three points: IoC@H_404_43 @: reverse control. Inversion control refers to pulling the control right from the class to the container, which is configured and managed by the instantiation and action of the container class. Dependency- injection@H_404_43 @: the dependency of the dependency injection object is set by the third-party component responsible for coordinating each object in the system when creating the object. Objects do not create or manage their dependencies, which are automatically injected into the objects that need them. Through parameters and configuration, we can realize how vivid the word "injection" is here. The biggest benefit of dependency injection is loose coupling. Instead of binding to a specific class, some dependencies are injected into the class in the form of parameters. Aspect Oriented Programming@H_404_43 @: tangential programming in software development, the functions distributed in many applications are called crosscutting concerns. These crosscutting concerns are often separated from business logic. Separating these crosscutting concerns from business logic is a problem to be solved in formal AOP. AOP programming can separate the functions scattered throughout the application to form reusable components. It is another embodiment of high cohesion and low coupling, which separates the general implementation module from the core business module. Specific reference: in fact, there are many data persistence frameworks in spring in action. What needs to be mastered is not only hibernate, but also because hibernate was used more in previous enterprise applications. In addition, mybatis also occupies a very important share. Hibernate is a fully automatic persistence framework, which is not so convenient, so many developers prefer to use mybatis, such as Taobao. Hibernate workflow: first, read the configuration file through the configuration object; Resolve mapping information and create standardsessionfactory; Call opensession to open the session; Create a transaction and then perform the persistence operation; After the transaction is completed, close the session and the sessionfactory. Figure 2 hibernate workflow should understand the concept of ORM: ORM means object relationship mapping. It is a technology to solve the mismatch between program object-oriented model and database relational model. The four state transitions and conditions of objects are more important in hibernate. They are transient transient state, persistent state, detached free state and removed state respectively. The state transition is as follows: Figure 3 hibernate object state transition diagram struts is the earliest and one of the thought providers. Its importance can be seen from its name. Its design purpose is to simplify java development and unify transaction aspects. The key to struts lies in the execution of action, the principle of interceptor, ValueStack and ognl. Specific reference: struts in action is too important to talk about. As a web developer, it will be very troublesome if you are not particularly familiar with HTTP. HTTP header format what do various return codes of HTTP protocol mean? HTTPS how to implement the working principle of B / S architecture cookie and session restful API don't list 23 modes here. Personally, I think it's no use just reading and learning design patterns. I should encounter them in practical applications and ask more why, And when you write your own code, you can have the awareness of using design patterns in order to have a deeper understanding of various design patterns. Of course, web development is far more than that. I have to list some important things here for the time being. After application development, there are deployment problems, so CDN and load balancing will be more complex In addition, in the process of web development, you should develop good development habits, such as skillfully using UML class diagrams and interaction diagrams before development, which will avoid you from making many mistakes. Thank the interviewer for his light abuse. I think there are still many places that are not solid. I still need to continue my efforts to deserve this opportunity. To sum up, the above is the sorting of Java Web architecture knowledge collected by programming home for you - remember all the contents of an Ali interview experience. I hope this article can help you solve the sorting of Java Web architecture knowledge - remember the program development problems encountered in an Ali interview experience. If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends. This graphic content is collected and provided by netizens on the Internet as a learning reference. The copyright belongs to the original author. Like to share programming technology and work experience with others. Welcome to join the official exchange group of programming house! Programming House official 1 group programming House official 2 group programming House official 3 group programming House official 4 group

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>