|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
What Makes Java Different from Other Languages?Sun boasts that Java is a concurrent, object-oriented programming language with client/server capabilities. In this section, well take that claim apart and examine each of Javas major distinctive qualities. Java Is a Programming Language In the late 1990s, the world of software is similar in many ways to the way things were in the late 1970s. In those days, PCs had just come out, and the available software lagged far behind the demand. However, nearly every model of PC shipped with a BASIC interpreter. Thousands of people who did not consider themselves professional programmersteachers, life insurance agents, bankerslearned BASIC and began to write programs. Often they would share their programs by floppy disk or, later, by electronic bulletin boardsand the shareware industry was born. Like SmallTalk, C, and C++ (and unlike BASIC), Java is designed for use by professional programmers. Today the Hypertext Markup Language (HTML) and the scripting languages, such as Netscapes JavaScript, occupy the niche formerly held by BASIC. Many people who do not consider themselves to be professional programmers cannot write Java applets, but they can use applets written by others to add life to their Web pages. Often they use Netscape LiveConnect, an integration technology based on JavaScript, to stitch Web pages, Java applets, and browser plug-ins together.
But this section is about Java. Unlike JavaScript, Java was designed for the experienced programmer. If youre a professional programmer, you should have little trouble learning Java. If you dont have prior experience with the object-oriented techniques, youll want to brush up on the object-oriented concepts.
Java Is Object Oriented In general, software engineers engage in five activities during the development of software:
During object-oriented analysis, you are encouraged to view the application domain as a set of related classes. In a transportation application, for example, there might be a class called Truck. When the application runs, it typically makes instances of these classes. You might build a fleet of trucks based on class Truck. During initial object-oriented design, you identify all the classes, typically arranging them in a hierarchy. Figure 36.3 illustrates where the class Truck might fall in a transportation hierarchy. You also identify methods and data that should be associated with each instance. Figure 36.4 illustrates one way of recording this information during the design activity.
After youve identified and described each class, you need to design the code for each method. Some designers prefer to write simple diagrams to show how each method should be written. Others prefer to write pseudocode, a loose method of coding that is intended to be read by humans rather than by the compiler. Object-oriented languages were introduced as early as 1967. During 1983, Bjarne Stroustrup of AT&T Bell Laboratories introduced a version of the popular C programming language that supported classes. This C with classes went on to become C++, the most popular object-oriented language everpossibly the most popular computer programming language ever. The people at Sun Microsystems who designed Java were C++ programmers. They understood the features of C++ that have made it a good language. They also understood its limitations. In designing Java, they copied C++ syntax and reused the best pieces of C++s design, including the fact that it makes it easy to code object-oriented designs.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |