Java Web Architecture Knowledge Collation __java

Source: Internet
Author: User
Tags aop java web
1. BottomThe Java language is irrelevant, the first is the structure and working principle of the JVM. The most important is the Java memory model, the various GC algorithms, the ClassLoader load principle and so on. Personal to the bottom of some things are relatively understanding, so not too much entanglements, in fact, the process of compiling the program and the binary file processing is still worth studying. JVM monitoring and tuning. As a developer, you don't necessarily need to be very familiar with JVM tuning, but if you have the ability to monitor and tune the JVM, you'll have a good grasp of the status of the program and be more sensitive to problem positioning. Java multithreading. The understanding of thread safety and how to avoid the inconsistencies caused by multithreading in your own programs. / o. Java is often mentioned in the Bio/nio, that is, blocking I/O and non-blocking I/O, in fact, it is not difficult to understand, combined with Linux in the synchronous I/O and asynchronous I/O implementation principle, basically are interlinked, each I/O solution problem, and what the problem, why use Epoll. 2.Servlet

A servlet is a Java program that runs on the server side, typically implementing its own Java server applications, inheriting from the HttpServlet class, and then implementing its own init | Doget | DoPost | Service method. The lifecycle of the servlet begins with its loading, performs an initialization first, invokes the Init method, and then runs its own service, calling the Destroy method to reclaim the resource and end the service when the lifecycle is over.

Understanding the principle of course is not enough, but also to combat the ability to write simple code in the IDE who will, but really let a program can run up also need something else, here I refer to the servlet container. There are a number of containers for the servlet, commonly used in Tomcat, for example, when Tomcat is installed, it must be included in Tomcat's Lib at development time. The IDE does spoil a lot of people, how the directory is organized, how the program compiles, how it is deployed, all of which are blocked by the IDE, and if you want to have a more thorough understanding of the whole, suggest everything from the command to the hand.

Specific reference: "Servlet and JSP core programming." 3. The Framework

The number of frameworks used for Java web development is downright outrageous, and the problems that occur as a result of a version update are endless. However, this is also the result of the evolution of Web technology, either choose to accept, or lead the rhythm. Spring

Spring is a powerful and "lightweight" Java development framework that quotes because it doesn't feel that light. The main purpose of spring is to simplify Java application development by configuring a method that replaces Hard-coded programming, module decoupling, and its architecture as shown in the following illustration. Includes data access, remote communications, AOP, core containers, and so on.

 

Figure 1 Spring Architecture

Spring's core is three points: IoC: Reverse control.

Inversion control means that the control right is drawn from the inside of the class to the container, and is configured and managed by the instantiation and action of the container class. Dependency-injection: Dependency Injection

Object dependencies are set by Third-party components that are responsible for coordinating each object in the system when creating objects. objects do not create or manage their dependencies on their own, and dependencies are automatically injected into the objects that need them. By using the parameters and configuration, you can see how the word "inject" works here. The biggest benefit of dependency injection is loose coupling. Instead of having to bind the class internally to a specific class, some dependencies are injected into the class as arguments. Aspect oriented programming: oriented to tangential programming

In software development, multiple functions distributed in applications are called crosscutting concerns. These crosscutting concerns are often separate from business logic, separating these crosscutting concerns from the business logic to be resolved by formal AOP. AOP programming enables the separation of functions across applications to form reusable components. is another embodiment of high cohesion and low coupling, separating the common implementation module from the core business module.

Specific reference: "Spring in Action" Hibernate

Data Persistence Framework also has a lot of, need to master not only hibernate, just because hibernate in the previous enterprise application of more than, in addition MyBatis also occupies a very important share. Hibernate is a fully automatic persistence framework, not so convenient, so many developers are more inclined to use MyBatis, Taobao is the case.

Hibernate workflow: First read the configuration file through the configuration object; Parse mapping information, create standardsessionfactory; call Opensession Open session ; Create transaction transaction, then persist operations, commit transaction after completion, close session, close sessionfactory.

Figuer 2 Hibernate work Flow

To understand the idea of ORM: Orm means object-relational mapping. is a technique to solve the problem of mismatch between object-oriented model and database relational model.

In Hibernate, the 4 state transitions and conditions of objects are more important. The transient instantaneous state, persistent persistent state, detached Free State and removal state are respectively as follows:

Figure 3 Hibernate object state conversion diagram Struts 2

Struts appeared as one of the earliest, and thought-providers, from the name of its importance, designed to simplify Java development, unified transaction slicing.

The key point of struts is the execution of the action, the principle of the interceptor, the Valuestack and the OGNL.

Specific reference: "Struts in Action" 4.HTTP

Needless to say, it's important that as a web developer, it would be a hassle to be unfamiliar with HTTP. HTTP Header format HTTP protocol's various return codes what do you mean https how to implement B/s architecture working principle cookies and Session principle restful API 5. Design Patterns

Here is not listed 23 models, individuals feel that pure reading to learn "design mode" does not have any use, to be encountered in the actual application, and ask a few more why, and write their own code can have the use of design patterns of consciousness to a variety of design patterns have a deeper understanding.

Of course, web development is much more than that, and I have to make a list of important things for the time being. After application development, there is also the problem of deployment, so it will involve CDN and load balancing problems are more complicated ...

In addition, in the process of web development, to develop good development habits, such as the ability to skillfully use UML class diagrams, interaction diagrams, etc., which will avoid you make a lot of mistakes.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.