Java learning path (3) process articles

zhaozj2021-02-16  50

Every human learning method is different, and a person's method is not suitable for another person, I can only talk about my own learning method. Because I learned that Java is completely self-study, I have never asked others, so the process of learning is basically completely exploited. I don't know if this method is a better way, I can only give you a point.

The first step in learning Java is to install JDK, write a Hello World, in fact, JDK's learning is not so simple, there are two questions about JDK, it is easy to have always plagued Java programmers: one is a classpath problem, in fact, from principle To say, how to figure out how JRE's ClassLoader loads Class; another problem is Package and Import issues, how to find the path problem of class. Take all the two questions and clearly remove the biggest obstacles to learning Java and using JDK. It is recommended to look at Wang Sen's "Java Deep Adventures" and discuss these two issues. The second step is to learn the syntax of Java. Java's grammar is class C , basic mainstream programming language is not class C, which is class C , there is no new thing, so the language of grammar is probably a half-day time. The only thing you need to pay attention is to have a few use, public, protected, private, static, when used, why is it used, how to use it, this may need someone to point to it, I originally complete myself I spent a long time. But then I saw "Thinking In Java" this book talking about these concepts.

The third step is to learn the characteristics of Java's object-oriented programming language. For example, inheritance, constructors, abstract classes, interfaces, polymorphisms, overloading, coverage, and Java exception handling mechanisms. For a person without an object-oriented language background, I think this process takes a long time, because I don't have C experience before Java, only C's experience, I spent about a month, I only thoroughly It is clear that these concepts are clear, try to figure out, revise, try, and see the contents of the chapters, seeing, can't see 5 times, it is completely realistic. But I think if there is C experience, it should be enough for a day or two. So in this process, you can see "Thinking in Java" book, which is very thoroughly explained to the object. Unfortunately, when I learned, I didn't see this book, so I spent a lot of time, learning through my own trial and trying to learn.

The fourth step is to start familiar with Java class libraries. Java's basic class library is actually the JDK installation directory below JRE / lib / rt.jar this package. Learning the underlying library is to learn RT.jar. There are very many classes in the base class library. It is said that there are more than 3,000, I have no statistics. But really is only 4 of our most core, respectively.

Java.lang. *;

Java.io. *;

Java.util. *;

Java.sql. *;

The four packages of these packages, each package can be written into a thick textbook, and O'Reilly is indeed doing this. I think if the time is tight, it is impossible to learn from four books. I think the better learning method is like this:

First, you must read the entire package framework, understand the configuration of the entire package, interface, Exception, it is best to find an article describing the entire package framework. The first few chapters of these special introduction packages should be the introduction of these overall frameworks. The grasp of the overall framework of the package is not to be familiar with each class, remember what properties, methods. I can't remember it. Instead, we must know what kinds of classes have a class, what is the use of these classes, and the most core of the core is done. When I gave it to the training, I generally speak a package, so I can't introduce the usage of each class, but I repeatedly stressed that I will tell you how to tell you how to call you. I don't ask you to remember the way the method is called, but I want you to know, what kind of Java provides us, every class is used, when I encountered a problem, I know which class, or Several combinations can solve my problem, That'All! When we write the program, as long as you know which class should be used to complete your job, it is enough. When encoding, the specific method is called, it is to write the code, check the documentation, all things are in the documentation, do not ask you to remember, actually can't remember more than 3,000 categories of total 100,000 methods transfer. Therefore, it is extremely important to grasp the grasp of the overall framework of each package.

In the fifth step, through the above learning, if you are more solid, you have a foundation of Java, and the rest of the job is to clear the other more than 4 packs other than the 4 packs in Documentation. class. Believe this step, Java's self-study ability has been cultivated, and it can be reached the level of Documentation directly. In addition to doing GUI programming, other people who have use in JDK are these:

Java.text. *;

Java.net. *;

Javax.naming. *;

There are few more classes that are really used in these packages. There are only a few, so you don't need to spend a lot of time.

Step 6, Java Web Programming

The core of the web programming is the HTTP protocol, the HTTP protocol and Java have nothing to do. If you are not familiar with the HTTP protocol, although you can also learn the servlet / JSP programming, but you will not reach the realm of one and one. So the learning of the HTTP protocol is essential. If you are familiar with the HTTP protocol, there is a good foundation for Java programming. Learning Servlet / JSP is easy, I have to use the servlet / jsp use less than a week, and then start with JSP to do projects.

In the study of servlet / jsp, the weight is still servlet documentation. The most common class of servlet API is very small, and it can be mastered. Take these classes to see several examples. Servlet / JSP Programming Nature is to call these classes repeatedly between Web Server and Brower through the HTTP protocol. In addition to JSP, you need to be familiar with several common JSP tags, and if you can't hold it, the temporary investment is.

In addition, Java web programming learning is to be placed in the design mode of Web Application, how to analyze business logic, and conduct reasonable design, follow the requirements of MVC design mode, using servlet and JSP to complete different logical layers, master how The flow control and data sharing between servlet and JSP, and how Web Application should be configured and deployed.

Step 7, J2EE programming

If the above learning process is relatively smooth, the difficulty is difficult to improve. Because the above knowledge is only involved in one aspect, the J2EE specification such as EJB, JMS, JTA is often a crystallization of several Java technology, so it is relatively difficult to master.

First, you must learn JNDI, JNDI is an App Server Location Server Resource (EJB Components, Datasouce, JMS) Finding Method, if you are not familiar with JNDI, EJB, JMS these things are almost university can't go. JNDI is actually javax.naming. * This package is easy to use. The difficulty is the configuration of the server resource file. For the configuration of the server resource file, you need to take a look at the special document specification, such as the WEB.XML of WEB.XML, EJB-JAR.XML Writings, and so on. For each different app server, there is also your own service resource profile, it is also familiar.

You can then learn JTA, mainly to understand the method of JTA's control for transactions, and what is used in any occasion. Here you can make an example, we know that the general situation can be transactional for a database connection (Conn.commit (False), ...., as an atomic operation, but assumes me Business requirements are to make operations for two different databases as an atomic operation, can you do? At this time, I can only use JTA. Suppose the operation process is first inserting a record first to the A database, then deleting another record of the B database, our own writing code is not controlling the entire operation as an atomic operation. With JTA, the APP Server is used to complete the control.

Learn to serialize and RMI before learning EJB, RMI is the basis of EJB. Then learn JMS and EJB. For EJB, the most critical is to understand how EJB is called by RMI to the call to the remote object, and in what circumstances to use EJB.

After learning EJB, JMS these things, you may be aware of the knowledge of two fields, one is UML, and the other is Design Pattern. Java Enterprise Software Design is very valid to the framework design, and a good software framework is a necessary condition for software development. At this time, you should start the focus of learning in design patterns and frameworks, master EJB design patterns and J2EE's core mode through learning and practical programming experience.

Inside the J2EE specification, there are many business technologies in addition to EJB, JMS, JTA, Servlet / JSP, JDBC, which is not introduced here.

There is also a new field Web Services. Web Services also does not have any new things, it is like a binder, you can unify different services to provide a unified call interface. As a user, I just get the WSDL for the service provider (on service Description), it is enough, I don't know if the service provider is EJB component, or is it .NET component, or what CORBA component, or other implementation, I don't need to know. The greatest place in Web Services is to achieve sharing of Internet services through unified service providing methods and calls, is a very exciting technical field. Web Services seems to have no good books, but can learn by checking information on the network.

转载请注明原文地址:https://www.9cbs.com/read-21338.html

New Post(0)