欢迎来到留学生英语论文网

当前位置:首页 > 论文范文 > Information Systems

Java

发布时间:2017-03-20
该论文是我们的学员投稿,并非我们专家级的写作水平!如果你有论文作业写作指导需求请联系我们的客服人员

Java Database Connectivity (JDBCTM): It provides access to a wide range of relational databases.

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers, collaboration, telephony, speech, animation, etc. The following figure shows what is included in the Java 2 SDK.

gs5

Swings:

Swing is an extension library to the AWT; it includes new and improved components that enhance the look and functionality of GUIs. Swing can be used to build Stand-alone swing GUI Applications as well as Servlets and Applets. It provides a model or view design architecture. Swing is more portable and more flexible than AWT.

Swing is built on top of AWT and is entirely written in Java, using AWT’s lightweight component support. Particularly, unlike AWT, the architecture of the Swing components makes it easy to customize both their appearance and the behavior. Components from AWT and Swing can be mixed, allowing you to add Swing support to existing AWT-based programs. For example, swing components such as JSlider, JButton and JCheckbox could be used in the same program with standard AWT labels, textfields and scrollbars. You could subclass the existing Swing UI, model, or change listener classes without having to reinvent the entire implementation. Swing also has the ability to replace these objects on-the-fly.

  • 100% Java implementation of components
  • Pluggable Look & Feel
  • Lightweight components
  • Uses MVC Architecture Model represents the data View as a visual representation of the data Controller takes input and translates it to changes in data
  • Three parts Component set (subclasses of JComponent) Support classes Interfaces

In Swing, classes that represent GUI components have names beginning with the letter J. Some examples are JButton, JLabel, and JSlider. Altogether there are more than 250 new classes and 75 interfaces in Swing — twice as many as in AWT.

Java Swing class hierarchy

The class JComponent, descended directly from Container is the root class for most of Swings user interface components.

java-swing

Swing contains components that you will use to build a GUI. We are listing you some of the commonly used Swing components. To learn and understand these swing programs, AWT Programming knowledge is not required.

Applications and Applets

An application is a program that runs on our Computer under the operating system of the computer. It is bit similar in creating using C or C++. Java’s ability to create Applets makes it important. An Applet is an application design to be transmitted over the Internet and executed by a Java –compatible web browser. An applet is actually a tiny Java program; dynamically it is downloaded across the network just like an image. But the difference is that it is an intelligent program it is not just a media file. It can react to the user input also and can dynamically change.

FEATURES OF JAVA:

Security

Every time you download a “normal” program, you are risking a viral infection. Prior to Java, most users will not download executable programs frequently, and those who did scan for them viruses prior to execution. Most of the users are still worried about the possibility of infecting their systems with a virus. In addition, another type of malicious program exists that must be guarded. This type of program can collect private information, such as credit card numbers, bank account balances, and passwords. Java answers both of these concerns by providing a “firewall” between a networked application and your computer. When you use a Java-compatible Web browser, you can safely download Java applets without fear of virus infection or malicious intent because java has security and no virus can adapt to the system.

Portability

Programs can be dynamically downloaded to all the various types of platforms connected to the Internet some means of generating portable executable code is needed .As you will see, the same mechanism that helps to ensure security it also helps to create portability. Indeed, Java’s solution to these two problems is both elegant and efficient.

The Byte code

The key that allows the Java to solve the problems of security and portability is that the output of Java compiler is Byte code. Byte code is a highly optimized. Byte Code is set of instructions designed to execute by the Java run-time system which is called the Java Virtual Machine (JVM). That is, in its standard form, the JVM is an interpreter for byte code.

Translation of a Java program into byte code helps makes it much easier to run a program in a wide variety of environments. The reason is once the run-time package exists for a given system any Java program can run on it.

Although Java was designed for interpretation there is technically nothing about Java that prevents on-the-fly compilation of byte code into the native code. Sun has just completed its Just- In-Time (JIT) compiler for byte code. When the JIT compiler is a part of JVM, it compiles byte code into the executable code in a real time on a piece-by-piece demand basis. It is not possible to compile an entire Java program into executable code all at once, because Java performs various run-time checks that can be done only at run time. The JIT compiles code as it is needed during the execution.

Java Virtual Machine (JVM)

Beyond the Java language there is the Java virtual machine. The Java virtual machine is an important element of the Java technology. The virtual machine can be embedded within a web browser or an operating system. Once a piece of Java code is loaded onto a machine it is verified as part of the loading process, a class loader is invoked and does byte code verification makes sure that the code that has been generated by the compiler will not corrupt the machine that it is loaded on. Byte code verification takes place at the end of the compilation process to make sure that it is all accurate and correct. So byte code verification is integral to the compiling and executing of Java code.

.Java .Class

The above diagram shows the development process is a typical Java programming uses to produce byte codes and executes them. The first box indicates that the Java source code is located in a .Java file that is processed with a Java compiler called JAVA. The Java compiler produces a file called a .class file which contains the byte code. The class file is then loaded across the network or loaded locally on your machine into the execution environment is the Java virtual machine which interprets and executes the byte code.

Java Architecture

Java architecture provides a portable, robust, high performance environment for development. Java provides portability by compiling the byte codes for the Java Virtual Machine which is then interpreted on each platform by the run-time environment. Java is a dynamic system able to load the code when needed from a machine in the same room or across the planet.

Compilation of Code

When you compile the code the Java compiler creates machine code (called byte code) for a hypothetical machine called Java Virtual Machine (JVM). The JVM is supposed to execute the byte code the JVM is created for overcoming the issue of portability the code is written and compiled for one machine and interpreted on all machines. This machine is called Java Virtual Machine.

During run-time the Java interpreter tricks the byte code file into thinking that it is running on a Java Virtual Machine. In reality this could be a Intel Pentium Windows 95 or Suns ARC station running Solaris or Apple Macintosh running system and all could receive the code from any of the computer through Internet and run the Applets.

SIMPLE

Java was designed to be easy for the Professional programmer to learn and to use effectively. If you are an experienced C++ programmer, learning Java will be even easier. Because Java inherits the C/C++ syntax and many of the object oriented features of C++. Most of the confusing concepts from C++ are either left out of Java or implemented in a cleaner and in a more approachable manner. In Java there are a small number of clearly defined ways to accomplish the given task.

Object-Oriented

Java was not designed to be source-code compatible with any other language. This allowed the Java team the freedom to design with a blank slate. One outcome of this was a clean usable, pragmatic approach to objects. The object model in Java is simple and easy to extend, while simple types, such as integers, are kept as high-performance non-objects.

Robust

The multi-platform environment of the Web places extraordinary demands on a program, because the program must execute reliably in a variety of systems. The ability to create robust programs was given a high priority in the design of Java. Java is strictly typed language; it checks your code at compile time and run time. Java virtually eliminates the problems of memory management and de-allocation, which is completely automatic. In a well-written Java program, all run time errors can –and should –be managed by your program.

What is networking?

Computers running on the Internet communicate to each other using either the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP), as this diagram illustrates:

1netw

When you write Java programs that communicate over the network, you are programming at the application layer. Typically, you don't need to concern yourself with the TCP and UDP layers. Instead, you can use the classes in the java.net package. These classes provide system-independent network communication. However, to decide which Java classes your programs should use, you do need to understand how TCP and UDP differ.

TCP

When two applications want to communicate with each other reliably then they establish a connection between them and then send data back and forth over that connection. This is analogous to making a telephone call. If you want to speak to Aunt Beatrice in Kentucky, a connection is established when you dial her phone number and she answers for your call. You send data back and forth over the connection by speaking to one another over the phone lines. Like the phone company, TCP guarantees that data sent from one end of the connection actually gets to the other end and in the same order it was sent. Otherwise an error is reported.

TCP provides a point-to-point channel for applications that require reliable communications between the computers. The Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), and Telnet are all examples of applications that require a reliable communication channel. The order in which the data is sent and received over the network is critical to the success of these applications. When HTTP is used to read from a URL, the data must be received in the order in which it was sent. Otherwise you end up with a jumbled HTML file a corrupt zip file, or some other invalid information.

Definition: TCP (Transmission Control Protocol) is a connection-based protocol that provides a reliable flow of data between two computers.

UDP

The UDP protocol provides for communication that is not guaranteed between two applications on the network. UDP is not connection-based like TCP. Rather, it sends independent packets of data called datagrams, from one application to the application. Sending datagrams is like sending a letter through the postal service. The delivery is not that important and is not guaranteed and each message is independent of any other.

Definition: UDP (User Datagram Protocol) is a protocol that sends independent packets of data called datagrams from one computer to another with no guarantees about arrival.Hence UDP is not connection-based like TCP.

上一篇:Wireless Sensor Network 下一篇:Windows server 2008 R2