Key terminology for Java "white paper"

Source: Internet
Author: User

key terminology for Java "white paper"  

Java's designers have written an influential "white paper" to explain the design's intentions and the completion of the situation, and have released a brief summary. This summary is organized in the following 11 key terms:
Portability of Simplicity
Object-oriented interpretation
Network Skills (network-savvy) High performance
Robust Multithreading
Security Dynamics
Architecture Neutrality
This section discusses the following main elements:
• Give an overview of each key term in the whitepaper, which is the Java designer's discussion of the relevant terminology.
• Get an understanding of these terms with the experience of using the current version of Java.
Note: White papers can be found on http://java.sun.com/docs/white/langenv/. For a discussion of 11 key terms, see http://java.sun.com/docs/overviews/java/java-overview-1.html.

1 simplicity

people want to build a system that can be programmed without esoteric professional training and conform to today's standard practices. As a result, although C + + is found to be less applicable, Java is designed to be as close to C + + as possible to make the system easier to understand. Java rejects many features that are seldom used, incomprehensible, and confusing in C + +. For the time being, these features are far more troublesome than the benefits they bring. Indeed, Java syntax is a "pure" version of the C + + syntax. There are no header files, pointer operations (even pointer syntax), structs, unions, operator overloads, virtual base classes, and so on (see the C + + annotations given in each chapter of this book, which explain the difference between Java and C + + in more detail). However, the designer did not attempt to clear all the inappropriate features in C + +. For example, the syntax of a switch statement does not change in Java. If you know C + + you will find it easy to convert it to Java.
If you are accustomed to using a visual programming environment (such as visual Basic), you will not find Java simple. Java has a lot of strange syntax (although it doesn't take long to master its essentials), and more importantly, it requires you to write a large number of programs yourself. The beauty of Visual Basic is that its visual design environment almost automatically provides a large number of infrastructure for applications. Using Java to implement the same functionality requires manual coding, often with a considerable amount of code. However, there are already third-party development environments that support the development of "drag-and-drop" style programs. The other aspect of simplicity is small. One of the goals of Java is to support the development of software that can run independently on small machines. The basic interpreter and class support is about 40KB, plus the base standard class library and support for threads (basically a self-contained microkernel) will need to increase by about 175KB. At the time, it was a remarkable accomplishment. Of course, because of the continuous expansion, the class library is quite large. There is now a separate Java mini-version (Java Micro Edition) with a smaller class library for embedded devices.

2 Object-oriented
In a nutshell, object-oriented design is a programming technique. It focuses on the data (that is, the object) and on the interface of the object. With a carpenter, for example, an "object-oriented" Carpenter always focuses on the chair being made and the second is the tool used; a "non-object-oriented" Carpenter first considers the tools used. In essence, Java's object-oriented capabilities are the same as C + +. In the past 30 years, object-oriented has proved its value, and a modern programming language that does not use object-oriented technology is simply unbelievable. Indeed, the object-oriented nature of Java is matched by C + +. The main difference between Java and C + + is multiple inheritance, in Java, instead of a simple interface concept, and Java's meta-Class (Metaclass) model.

3 Network Skills

Java has an extended example libraries for dealing with TCP/IP protocols such as HTTP and FTP. Java applications can open and Access objects on the network through a URL, as easily as accessing a local file. People have seen Java's network capabilities powerful and easy to use. Anyone who has ever tried to do network programming in another language will exclaim that Java has made such a heavy task like opening a socket connection so simple. In addition, the remote method invocation mechanism enables communication between distributed objects.

4 Robustness
One of the design goals of Java is to make programs written in Java Multi-faceted and reliable. Java has put a lot of effort into early problem detection, late-stage dynamic (runtime) detection, and elimination of the state of error tendencies ... The biggest difference between Java and C + + is that the pointer model used by Java can eliminate the possibility of rewriting memory and corrupting data. This feature is very useful. The Java compiler detects many problems that can be detected only at run time in other languages. As for the 2nd, the Java feature is a must for those who have spent several hours checking for memory collisions due to pointer bugs. If you've ever used only a language that doesn't have explicit pointers to Visual Basic, you'll feel like it's a little overkill to say so. However, C programmers are not so fortunate. They need to use pointers to access strings, arrays, objects, very
to the file. In Visual Basic, you do not have to use pointers to access these entities at all, and you do not have to care about memory allocation issues. On the other hand, in languages without pointers, many data structures are difficult to implement. Java has the advantage of both sides. It does not require the use of pointers to construct structures such as strings and arrays. If necessary, it can also have the ability to have pointers, such as linked lists. Java is absolutely secure, because it never accesses a "bad" pointer, causes memory allocation errors, and does not have to guard against memory leaks.

5 Security
Java is suitable for network/distributed environments. In order to achieve this goal, the security has invested a lot of energy. Use Java to build anti-virus, tamper-proof systems. The 1th edition of the book once said: "Never say absolutely!" ”。 It turns out to be true. Shortly after the 1th edition of the Java Development Toolkit was enabled, some security experts at Princeton University found some very hidden bugs in some of the security features in JDK1.0. Sun Microsystems strongly supports the study of Java security, develops specifications for people to use, implements virtual machines and security libraries, and quickly handles all known security bugs. In any case, it is very difficult to deceive Java's security mechanisms. Now, the technology to find bugs is getting stronger and fewer. From the outset, Java was designed to protect against various attacks, including:
• Run-time stack overflow. For example, worms and other viruses commonly used attack means.
• Destroys memory outside of its own processing space.
• Read and write files without authorization.
Many security features continue to be added to Java in succession. Since the advent of Java1.1, Java has had the concept of a digital signature class (digitally signed Class) (see volume II). By using a digitally signed class, you can determine the author of a class. If you trust the author of this class, the class can have more permissions on the machine.

Note: An ActiveX-based competitive code transfer mechanism from Microsoft relies solely on digital signatures for its security. This is clearly not enough because any user of Microsoft's own products can attest that programs from reputable providers will crash and compromise the system. Java has a much better security mechanism than ActiveX because it controls the application while it is running, and it can stop malicious damage.

6 Architecture Neutrality
The compiler generates an architecture-neutral destination file format, which is a compiled code that can run on many processors as long as there is a Java runtime system. The Java compiler implements this feature by generating bytecode directives that are not related to a particular computer architecture. Well-designed bytecode not only makes it easy to

The execution is interpreted on any machine and can be quickly translated into the code of the local machine. This is not a new idea. More than 30 years ago, this technique was used in both the original Pascal and the UCSD Pascal system, which was implemented by Niklaus Wirth. Of course, explaining bytecode will certainly be much slower than running a machine instruction at full speed. So, it's not a good idea to say it too! However, the virtual machine has an option to translate the most frequently used sequence of bytecode into machine code, a process known as instant compilation. This strategy has proved to be very effective, resulting in Microsoft's. NET platform is also dependent on the virtual machine. Virtual machines also have some other advantages. A virtual machine can detect the behavior of a sequence of instructions to enhance its security. Some programs can also generate bytecode quickly and dynamically enhance the processing power of the running program.

7 portability
Unlike C and C + +, there is no "dependency-specific implementation" in the Java specification. The size of the base data type and the algorithms are clearly explained. For example, an int in Java is always a 32-bit integer, whereas in C + +, an int may be a 16-bit integer, a 32-bit integer, or another size specified by the compiler provider. The only limitation is that the size of the int type cannot be less than shortint and cannot be higher than long int. In Java, the data type has a fixed size, which eliminates the major headache of code porting. Binary data is stored and transmitted in a fixed format, eliminating the problem of byte order. The string is stored in the standard Unicode format. As a system component of the class library, a portable interface is defined. For example, there is an abstract window class that gives different implementations in Unix, Windows, and Macintosh environments. Anyone who tries knows how difficult it is to write a program that looks good on Unix, in Windows, the Macintosh, and 10 different styles. Java 1.0 is trying to do this feat by publishing a simple toolbox that maps common user interface elements to different platforms. Unfortunately, it takes a lot of effort to build a library that is hard to accept on every platform (and there are different bugs in the graphical implementations of different platforms). However, this is a beginning after all. Portability is more important than a flashy user interface for many application issues, and these applications benefit from earlier versions of Java. Now, the user interface Toolbox has been completely rewritten, no longer dependent on

User interface to the host. Now the Java version is more stable and more appealing than the earlier version.

8 Explanatory type

The Java interpreter can execute Java bytecode on any machine that has ported the interpreter. Because links are a value-added and simple process, the development process becomes faster and more exploratory. Value-added links have their advantages, but the benefits to the development process are obviously exaggerated. In fact, early Java development tools were quite slow. Now, use the instant compiler to translate the bytecode into machine code.

9 High Performance
Although the interpretation of bytecode performance has been satisfactory, but in some cases requires more efficient performance. Bytecode can be quickly translated (at run time) into the machine code of the specific CPU running the application. Using Java for the first few years, many users disagree with the view that performance is "more adaptable". Now, however, the instant compilers have been so good that they have become rivals for traditional compilers. In some cases, even beyond the traditional compilers, the reason is that they contain more information available. For example, the instant compiler can monitor what code is often executed and optimize the code to improve speed. A more complex optimization is to eliminate function calls (i.e. "inline"). Instant compilation
The device knows which classes have been loaded. If a particular function is not overwritten, it can be embedded, based on the class set that is currently loaded. If necessary, you can also undo the optimization.

10 Multi-Threading

Multithreading can lead to better interactive responses and real-time behavior. If you've ever used a multithreaded application in another language, you'll marvel at the convenience of Java multithreading. Threads in Java can take advantage of multiple processors as long as the operating system supports it. At the bottom, the thread implementation mechanisms of the mainstream platform are different, and Java does not take much effort to achieve platform independence. In different machines, only the code that calls multithreading is exactly the same; Java gives the implementation of multithreading to the underlying operating system or line libraries to complete. However, the simplicity of multithreaded compilation is one of the main reasons why Java has become an attractive server-side development language.

11 Dynamic Nature

From a variety of perspectives, Java is more dynamic than C or C + +. It is able to adapt to the constantly evolving environment. The library is free to add new methods and instance variables without any effect on the client. Finding run-time type information in Java is straightforward. Dynamic is a very important feature when you need to add some code to a running program. A good example is downloading code from the Internet and running it on a browser. In Java 1.0, the runtime's type information cannot be obtained directly, while the current version of Java allows the programmer to know the structure and behavior of the object. This is useful for systems that must parse objects at run time. These systems are: Java GUI Builder, Smart Debugger, pluggable component, and object database.
Note: Shortly after Java was successfully launched, Microsoft released a product called J + +, which has the same coding as Java
Language and virtual machines. Now, Microsoft no longer supports J + + and is replaced by another language called C #.
C # has a lot in common with Java, but it uses a completely different virtual machine. There is even a J # language that can
Migrate the application of J + + to a virtual machine using C #. This book is not intended to introduce J + +, C #, or J # languages.

Key terminology for Java "white paper"

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.