Transferred from: http://blog.csdn.net/JasonLiuLJX/article/details/51494048
Recently made a few Java Web projects, there are business projects, there are individuals to do small projects, write an article to summarize the harvest, listing the whole process of doing the project, the need to use the skills and knowledge points, to have not really touched the full Java Web project students A more complete perspective, provide a so-called "bigger Picture", but also to facilitate students to learn more targeted. Of course, the example projects used here are very elementary, simple projects, so the gods can not look down.
First we start with the architecture of the site. In general, we divide the site into front-end and back-end. Front-end is mainly responsible for the display of the page, the backend is the implementation of business logic. Due to the rise of HTML5, the front-end field has become more and more hot, front-end technology development extremely fast, today we do not do too much introduction, because now the internet company, front-end engineers and Java engineers are completely different two technical positions. So we look at a project from a Java perspective. In the first few years, or in the classic Java Web Development paradigm, we use JSP technology as the implementation of the presentation layer, in fact the so-called front end. Of course, only know that JSP is not enough also need to understand Html,css,js,ajax and other front-end basic technology, JSP technology in which play the role of outer packaging. What about the back end? The backend is composed of some implementations of the business logic Java code and the database. Speaking of this, we can launch the classic MVC pattern in web development, Model-view-controller. View, refers to the presentation layer, model, is used to carry data of the abstract structure, and controller is the view and model of the bridge. View exists with the front-end code, Controller,model exists in the back-end code. In the back-end code, in order to ensure that the code is neat, easy to read, generally adopt a layered approach, from top to bottom into the controller layer, service layer, DAO layer, data layer or called the Persistence layer (directly with the database). Sometimes, in order to achieve the purpose of decoupling, the interface layer of response is added in the middle of the above-mentioned base, so that the interface and implementation are separated. In larger sites, more complex architectures, such as a layer of caching between the DAO layer and the data layer, or increased access pressure, require the use of advanced technologies such as clustering and load balancing, but here we do not discuss complex architectures in depth.
So above we see that a Web project front end needs to represent layer, backend has controller layer, service layer, DAO layer, persistence layer. In the presentation layer, in addition to the basic knowledge such as the html,css,js,ajax,jsp mentioned earlier, in the actual development, we will also use a lot of framework technology, such as Tiles,velocity,freemarker and other template technology to simplify the development of the presentation layer. In the persistence layer, in addition to JDBC, there are frameworks such as mybatis,hibernate to improve development efficiency. The most dazzling part of the Java Web is spring, which, as a framework throughout the project, brings dependency injection and aspect-oriented programming to project development. In addition to these, we also need to master the use of a relational database, such as mysql,oracle, of course, it is better to master a non-relational database, Mongodb,redis.
Master the above points of knowledge, congratulations, you can already start writing Java Web project. But it will only be written and not deployed, and our project still cannot be used. So speaking of which, our project code has been written well, what to do next? Of course it is necessary to find a container to run our code. The container here is of course not the data type in Java, but refers to the application server, where the application server and the Web server are particularly distinguished, as to what the Web server is, will be introduced later. (If a classmate is not very clear about the concept of the server, you can first look at the next paragraph, and then come back to see) at present, the market is the main popular application server has Tomcat,jetty,jboss and so on. Many people will ask why we need an application server? As the name implies, the application server is used to run our application code. Specifically, the Java Web uses Dynamic Web technologies like Jsp,servlet, and the code for these technologies must be running in the application server. So once we've written the application code, we need to deploy our app to the application server. After the application is deployed, how can users access it? Do you have direct access to the application server? This is the time for the Web server to appear. On the Internet, the most powerful application layer protocol is the HTTP protocol, people visit the site through the HTTP protocol to access, and the Web server is the HTTP protocol to support the server, so called the HTTP server. The Web server receives an HTTP request and then forwards the request to the application server. Someone will ask the user direct access to the application server is not good? Why should I give it to the Web server and then to the application server? From the functional realization, it is possible. Many application servers, such as Tomcat, are capable of having a Web server, so direct access is also possible. However, in the actual production environment, due to load balancing, CDN acceleration and other reasons, we still need to add a Web server to the front end of the application server to improve access efficiency, commonly used nginx,apache such a server.
Before always talking about this server, the server, do not know if there is no classmate listening to the ignorant. In fact, the concept of the server, we should have been in real contact with the computer professional field has been heard before, such as the previous playing games think the card when everyone will occasionally use the word server. But I really understand and study the server is learning Tomcat, jetty only after the start. So what exactly is the server? The concept of server is actually very simple, is a computer, then it and our daily use of the computer what is the difference? First, it generally does not have a monitor, it only hosts. Second, its operating system is different from our usual windows, Mac OS. More is the *nix system. Thirdly, it runs some server-side software. For example, we mentioned that Tomcat, Jetty, Nginx,apache, in fact, these are server software, but the host run the software, so sometimes people confuse the term. So the so-called database server, we also know that, in fact, is running the database of the host. When it comes to servers, the key knowledge we need to master is the server operating system, which is the Linix system, such as CentOS, Ubuntu, etc.
Speaking of which, in fact, a simple complete Java Web project is almost. Let's recap briefly, first of all, we need to use various frameworks and development techniques to write application code. Next, we need a host that installs the Linix system, installs the Web server software on it, applies the server software, and deploys our application code to the application server. Now we only need to get the IP address of the host, we can access the application remotely.
List of Knowledge points: development:
- View Layer Technology--html,css,js,ajax,tiles,velocity,freemarker
- Persistent Layer Technology--mybatis,hibernate
- Spring, Spring MVC
- Project Building Tools Maven
- Log log4j
- Version Control Git
Database technology:
- SQL statements
- Parameter tuning
Operating system:
- Master a Linux system, principles, shell commands
Server technology:
- Proficient in using and understanding the principles of an Application server technology (TOMCAT)
- Proficient in using and understanding the principles of a Web server technology (NGINX)
Additional: Caching Technology:
- Proficient in using and understanding a caching technology (Redis,memcache,ehcache)
Non-relational database
- Proficient in using and understanding a non-relational database (MongoDB)
Middleware Technology:
- Jms:activemq and Kafka
- Rpc:dubbo
Design mode:
- Understand and be able to use several of the most important design patterns
Internet:
- Proficient in using and understanding a network development technology (NETTY)
- Familiar with HTTP,TCP protocol
Java Virtual machine:
- Familiar with JVM operating principle, memory distribution
- Tuning JVM Parameters
The skills needed to do a complete Java Web project [go]