Java learning from getting started to mastering (3)

Source: Internet
Author: User
Tags object serialization ibm developerworks
Java learning from the beginning to the proficient (3)-General Linux technology-Linux programming and kernel information, the following is a detailed description. Step 7: J2EE Programming

If the above learning process is relatively smooth, the difficulty increases sharply. Because the above knowledge only involves one aspect, and core J2EE specifications such as EJB, JMS, and JTA are often the result of the comprehensive application of several Java technologies, therefore, it is difficult to master.

First, you must learn the JNDI. The JNDI is the method used by the App Server to locate Server resources (EJB components, Datasouce, JMS). If you are not familiar with JNDI, EJB, JMS is almost impossible to learn. JNDI is actually the javax. naming. * package, which is easy to use. The difficulty lies in the configuration of server resource files. For the server resource file configuration, you need to look at the specific documentation specifications, such as web. xml writing, ejb-jar.xml writing and so on. You need to be familiar with each different App Server and its own service resource configuration files.

Then we can learn about JTA, mainly to understand the JTA's method of controlling transactions, and where to use JTA. Here is a simple example. We know that transaction control (conn. setAutoCommit (false ),...., conn. commit () is used as an atomic operation, but if my business needs to use operations on two different databases as an atomic operation, can you do it? At this time, only JTA can be used. Assume that the operation first inserts A record into database A and then deletes another record in database B. We cannot control the entire operation as an atomic operation by writing code on our own. If JTA is used, the App Server controls it.

Before learning EJB, you need to learn Object serialization and RMI. RMI is the foundation of EJB. Next, we will learn about JMS and ejbs. The most important thing for ejbs is to understand how ejbs call remote objects through RMI, and under what circumstances to use ejbs.

After learning about EJB and JMS, you may realize that you need to learn more about the two fields: UML and Design Pattern. Java Enterprise software design attaches great importance to Framework Design. A good software Framework is a necessary condition for successful software development. At this time, we should begin to focus on the learning of the design mode and framework, and master the EJB Design Mode and the core mode of J2EE through learning and practical programming experience.

In the J2EE specification, there are many enterprise technologies in addition to EJB, JMS, JTA, Servlet/JSP, and JDBC, which are not described here.

There is also a new field of Web Services. Web Services does not have any new things at all. It is like a binder. Different Services can be unified to provide a unified call interface. for users, I only need to obtain the WSDL (service description) provided by the service provider. I have no idea whether the service provided by the server provider is an EJB component or. I don't need to know about the Net component, what is the CORBA component, or other implementations. The greatest part of Web Services lies in the sharing of Internet Services by means of unified service provision and calling. It is a very exciting technical field. Web Services does not seem to have any good books yet, but you can learn it by checking information on the Internet.
Java Learning Path (4) Method

Java as a programming language, the best way to learn is to write code. After learning a class, you can write a simple example program to run it to see what the result is, and then call several more class methods to see the running result, in this way, the class is learned intuitively and the memory is very deep. The code should not be called. You should think about it. If I don't write it like this, try again. I remember which expert said that learning programming is a process of destruction. After running the examples in the book and learning the examples compiled by Documentation, he constantly tries to implement them in different ways, constantly try to break the code structure and see what results it will have. In this way, you will have a thorough understanding of Java.

For example, we have compiled Hello World.

Public class HelloWorld {
Public static void main (String [] args ){
System. out. println ("Hello World ");
}
}

Many beginners do not quite understand why the main method must be defined as public static void main (String [] args) in this way. Can it be written like this? This includes questions when I first learned Java. Do you want to know the answer? It is very simple. You should change the main name to run it to see what errors are reported and analyze them based on the error information. Remove the public of main and try again to see what errors are reported; static removal can still be run; do not know if the main method must pass a String [] array, change String [] to int [], or try it out; if you do not know whether to write the args parameter name, you can also change the args to another name to see how the running result works.

This is what I did when I first studied Java. I modified the Hello World Program seven or eight times and kept running and analyzed the running results, finally, I fully understand why the main method is defined in this way.

In addition, I didn't understand staic, public, private, Exception, try {} catch {} finally {} and so on at the beginning. They all succeeded in running the example above the reference books, then, I began to destroy it and constantly rewrite the program based on my questions to see if it could run, what it was like to run, and whether it could get the expected results. This is time-consuming, but an example program is destroyed several times in this way. I have completely learned the relevant knowledge. Sometimes you may even intentionally write some wrong code to run it and see if you can get the expected running error. In this way, we have a profound understanding of programming.

Among them, it is particularly worth mentioning that JDK has a very good debugging function,-verbose

Java? Cverbose

Javac? Cverbose and many other JDK tools have this option.

-Verbose can display the classes loaded by the JVM in sequence during command execution. Through these valuable debugging information, this helps us analyze what the JVM has done during execution.

In addition, many of the destructive routines you write during the learning process should be consciously stored in different categories, and the typical routines accumulated in your work should also be sorted regularly, you have a code library. If you encounter similar problems, just Copy & Paste, Search & Replace in the code library, which greatly improves the development speed. The ideal situation is to abstract some common routines to form a common class library and encapsulate them. The reusability is enhanced.

So I don't think it is really a special routine. The destroy routine you write is the best example. If you are not at ease with the code you write, I strongly recommend that you check the Java source code of the JDK base class library. There will be a src.zip under the JDK installation directory, and you can see the entire JDK base class library, that is, rt. jar Java source code. You can refer to how Sun writes Java programs and what the specifications look like. When I am learning Java class libraries, when I do not understand them clearly or want to understand the operation details more clearly, usually open the source code of the corresponding class. by looking at the source code, all problems will be swept away.

Java Learning Path (5) Resources

1. http://java.sun.com)

Sun's Java website should be visited frequently. Needless to say.

2. http://www-900.ibm.com/developerWorks/cn/

For the IBM developerWorks website, go to the English site. This is not only an excellent Object-Oriented Analysis and Design website, but also an excellent website for Web Services, Java, and Linux. It is strongly recommended !!!

3. http://www.javaworld.com)

Discussions and news about many new Java technologies. I 'd like to know more about all aspects of Java, which is better here.

4. http://dev2dev.bea.com.cn/index.jsp

BEA's developer field, BEA, as the most important App Server vendor, has many unique technologies that can be missed by partners who develop on Weblogic.

5. http://www.huihoo.com/

The gray fox power website, a professional middleware website, is not a professional Java website, but has profound accomplishments in J2EE enterprise application technology.

6. http://www.theserverside.com/home)

The Server Side? Is a famous website dedicated to Java Server applications.

7. http://www.javaresearch.org/

The Java research organization has many excellent articles and tutorials on Java, especially in JDO.

8. http://www.cnjsp.org/

JSP technology websites have a considerable number of Java articles and resources.

Http://www.jdon.com/

Jdon forum is a personalized Chinese J2EE Professional Technology Forum. Among the many Java Chinese forums, Jdon is a forum with high technical content and excellent post quality.

Http://sourceforge.net/

Sourge Forge? It is the base camp of open-source software, which also has a very rich set of Java open-source famous software.

11. http://www.ddvip.net/
Many articles about JAVA teaching are worth reading.
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.