The learning path of object-oriented programming language in Java

Source: Internet
Author: User
Tags documentation exception handling interface net object serialization resource web services java web
Programming | objects

The first step is to install the JDK.

Write a Hello world,? In fact, the JDK learning is not so simple, there are two problems with the JDK is easy to always haunt the Java programmers Place: One is the classpath problem, in fact, in principle, is to find out how the JRE ClassLoader is loaded class Another problem is the package and import issues, and how to find the path problem of the class. By finding out the two issues, the biggest obstacle to learning Java and using JDK is clear. It is recommended to take a look at Sen Wang's "Java Depth Adventures" to discuss these two issues in depth.

The second step is to learn Java syntax

Java syntax is a class C + +, basically the mainstream programming language is not the class of the CS, is the type C + +, there is nothing new, so the grammar of the study, probably half a half-day time enough. The only thing to be aware of is that there are a few difficult to figure out the use of keywords, public,protected,private,static, when to use, why to use, how to use, this may need someone to point out, I was completely myself figured out, spent a long time. But then I saw the book "Thinking in Java", which read these concepts.

The third step is to learn the characteristics of Java object-oriented programming language

such as inheritance, constructors, abstract classes, interfaces, polymorphism of methods, overloads, Overrides, Java exception handling mechanisms. For a person who doesn't have an object-oriented language background, I think this process will take a long time, because learning Java before the experience of C + +, only the experience of C, I was about to spend about one months or so, only to thoroughly understand these concepts, the book above the example repeatedly try to figure out, modify, attempt, The contents of those chapters repeatedly look over, look at the past, see more than 5 times, only to thoroughly comprehend. But I think if you have C + + experience, it should be a two-day time enough. So in this process, you can take a look at the book "Thinking in Java", the object-oriented explanation is very thorough. Unfortunately, when I study, and did not see this book, so I spent a lot of time, through their own attempts and try to learn.

The fourth step is to start familiar with Java class Library

Java's base Class library is actually Jre\lib\rt.jar this package under the JDK installation directory. Learning the Basic class library is learning Rt.jar. There are very many classes inside the base Class library. It is said that there are more than 3,000, I do not have statistics. But the real core for us is only 4, respectively

java.lang.*;

java.io.*;

java.util.*;

java.sql.*;

This four-pack study, each bag of learning can be written as a thick textbook, and O ' Reilly did do so. I think if time is tight, it is impossible to learn by reading four books. I think the better way to learn is this:

The first step is to read through the entire package framework, to understand the composition of the entire package class,interface,exception, preferably to find articles that introduce the entire package framework. The first chapters of these books that specialize in packages should be an introduction to these overall framework content.

The overall framework of the package is not to familiarize yourself with the usage of each class, to remember what attributes it has, and how. I can't remember it. It's about knowing what the package has to do with the classes, what these classes are for, and how many of the core classes are done. When I give people training, I usually talk about a bag in class. So it is not possible to describe the use of each class in detail, but I repeat that I am telling you these packages not to tell you how the class method is invoked, nor do you want to remember the method calls of the class, but rather you understand what Java provides us with the classes, where each class is used, when I encounter a problem, I know which class, or the combination of the classes, can solve my problem, that ' all! , when we specifically write the program, as long as you know which class to use to complete your work is enough. When coding, the specific method call, is the side writes the code, the side checks documentation, all things are inside the documentation, does not require you must remember, actually you also can not remember 3,000 multiple class's altogether nearly 100,000 method calls. Therefore, the overall framework of each package to grasp the importance of becoming extremely important.

Through the above study, if the study of a more solid, then lay the foundation of Java, the rest to do is to clear the documentation inside in addition to the above 4 packets of other more useful classes. Believe that progress to this step, the ability to self-study of Java has been cultivated, can be directly to learn the level of documentation. In addition to GUI programming, other useful packages in the JDK are these:

java.text.*;

java.net.*;

javax.naming.*;

These bags really use more of the class is actually very few, only a few, so do not need to spend a lot of time.

Fifth Step Java WEB programming

The core of Web programming is the HTTP protocol, HTTP protocol and Java-independent, if not familiar with the HTTP protocol, although also can learn servlet/jsp programming, but not to extrapolate, Itong realm. So the study of HTTP protocol is necessary. If you are familiar with the HTTP protocol, and have a good foundation for Java programming, Learning servlet/jsp is simply easy, I learn servlet/jsp used less than a week, and then began to use JSP to do the project.

In Servlet/jsp's study, the documentation is still the servlet. The Servlet API has few classes that are most commonly used, and it takes less time to master. Look over these classes and write a few more examples to try. The essence of servlet/jsp programming is to call these classes over and over again to communicate between the Web server and brower through the HTTP protocol. In addition to JSP, but also need to be familiar with several common JSP tags, the specific wording of the words, temporary check just.

In addition, Java Web Programming learning focus on the Web application design mode, how to conduct business logic analysis, and reasonable design, according to the MVC design pattern requirements, using servlet and JSP to complete different logic layer, Learn how to control and share data between the servlet and the JSP, and how the Web application should be configured and deployed.

Sixth Step Java programming

The above learning process if it is relatively smooth, to this step, difficulty and suddenly improve. Because the above knowledge content is only involved in one aspect, and such as EJB,JMS,JTA, such as the core of the Java EE specification is often a combination of the use of a number of techniques of the crystallization, so it is difficult to master the larger.

First of all, we must learn good Jndi,jndi is the app Server Locator Server resource (EJB component, DATASOUCE,JMS) lookup method, if not familiar with Jndi, ejb,jms these things can hardly learn. Jndi is actually javax.naming.* this bag, it is very simple to use. The difficulty is in configuring the server resource files. For the server resource file configuration, you need to look at the specific documentation specifications, such as Web.xml, Ejb-jar.xml, and so on. For each of the different app servers, there are also their own service resource profiles that need to be familiar.

You can then learn JTA, mainly to understand JTA's approach to the control of the transaction, and where to use JTA. As a simple example, we know that the general situation can be transaction control for a database connection (Conn.setautocommit (false),...., Conn.commit ()) as an atomic operation, But suppose my business requirement is to make the operation of two different databases an atomic operation, can you do it? At this time can only use JTA. Suppose the procedure is to insert a record into a database, then delete the B database another record, we write the code can not control the whole operation as an atomic operation. With JTA, the app server is the way to complete the control.

Learning about object serialization and Rmi,rmi is the basis of EJB before learning EJB. Then, to learn about JMS and EJB, the key to EJB is to understand how EJBS implement calls to remote objects through RMI, and under what circumstances EJB is used.

After learning ejb,jms These things, you may be aware of the impatience to learn two areas of knowledge, one is UML, the other is design pattern. Java enterprise Software Design attaches great importance to the framework of the design, a good software framework is the prerequisite for the success of software development. At this time, should begin to focus on the study of design patterns and framework of learning, through learning and practical programming experience to master the EJB design pattern and Java EE core model.

Java-ee norms inside, in addition to EJB,JMS,JTA,SERVLET/JSP,JDBC, there are a lot of enterprise technology, here is not one of the introduction.

There is also a new domain Web Services. Web Services doesn't have anything new at all, it's like a binder that can unify different services to provide a unified calling interface, and as a user, I just get the WSDL (the description of the service) given to me by the service provider, and that's enough, I have no idea whether the service provided by the server provider is an EJB component, or. NET component, or what CORBA component is, or what other implementations, I don't need to know. The greatest part of WEB services is the sharing of Internet services across the world through a unified approach to service delivery and invocation, which is a very exciting technical area. WEB services do not seem to have any good books at the moment, but they can be learned by looking up information on the web.



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.