📄 034-038.html
字号:
<HTML>
<HEAD>
<META name=vsisbn content="1558515682"><META name=vstitle content="Java Digital Signal Processing"><META name=vsauthor content="Douglas A. Lyon"><META name=vsimprint content="M&T Books"><META name=vspublisher content="IDG Books Worldwide, Inc."><META name=vspubdate content="11/01/97"><META name=vscategory content="Web and Software Development: Programming, Scripting, and Markup Languages: Java"><TITLE>Java Digital Signal Processing:Java and Its Promise</TITLE>
<!-- HEADER --><STYLE type="text/css"> <!-- A:hover { color : Red; } --></STYLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<!--ISBN=1558515682//-->
<!--TITLE=Java Digital Signal Processing//-->
<!--AUTHOR=Douglas A. Lyon//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=1//-->
<!--PAGES=034-038//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="029-034.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch02/039-041.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading17"></A><FONT COLOR="#000077">Summary</FONT></H3>
<P>In this chapter we discussed Java’s good and bad points. Java’s virtual machine is probably the reason Java is a successful technology. The Java language depends on a tightly integrated JVM and probably could not exist without it. Once the Java language and JVM were specified, flexibility depended on the Java class libraries. As soon as we transgress the boundary of the class libraries and JVM, Java becomes unsafe and nonportable. Java’s growth depends on a growing set of portable class libraries. For those elements that are not portable (such as serial port support), the programming community must depend on Sun for API growth. This is quite a drawback.
</P>
<P>This chapter also looked into the Java model as a means of creating decoders for Web browsers. Again, we noted that the Java class libraries lack the richness needed to support a wide variety of formats. Furthermore, Sun was cited for not advertising the API needed to manipulate an audio data stream. The Java language has so many demands that Sun cannot possibly support them all!</P>
<P>This chapter outlined Java’s basic attributes: that it has no header files, macros, pointers, multiple inheritance, integer arguments to conditionals, structures, unions, or operator overloading. The language is portable and provides built-in garbage collection, a GUI library, array index checking, security features, threading, and exception handling. Java relies on the IEEE 754-1985 floating-point specification.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>SHORTCUT: </B>One of Java’s big early drawbacks—that the byte code interpreter is slow—is being addressed. The JIT compilers blow away the byte code interpreters. Because of a smaller RAM footprint, byte code interpreters may be better for embedded systems. Even so, on desktop development systems the JIT compiler technology is a breakthrough.<HR></FONT>
</BLOCKQUOTE>
<P>The Java language confuses applets and applications and has mixed mode array declaration, confusing operator overloading for strings, fragile base classes, an inability to call C++, and an impoverished API. Java is not a pure object-oriented language. The API is generally improving, but the other drawbacks may be hard to fix.
</P>
<P>No hype and no hyperbole: Java is a tool, and, like any tool, it is useful only for some applications.</P>
<P>Is Java suitable as a first programming language? As a teaching tool, Java is better than C or C++, but that damns Java with faint praise. Many first courses in programming are taught with C or C++, almost certainly because of industry demands. Now that industry appears willing to accept Java, introductory courses are switching to Java in great numbers.</P>
<P>As a tool for delivering cross-platform software, Java dominates any other technology we have seen. When we attempted to write portable programs in the past, we tried to use only the features supported by ANSI standards. Even under these circumstances, the porting of GUI-based code was tricky at best. DiffCAD, a program with over 180 Java files, ported to Java virtual machines running under MacOS, Solaris, and Windows 95/NT without recompilation.</P>
<P>Is Java suitable for engineering? That depends on the application. At this writing, Java has no support for serial ports. If the application involves data acquisition and processing via unsupported hardware (such as serial ports or video digitization cards), the answer could be no. Writing device drivers with interfaces to Java programs is not easy. Perhaps after native methods become easier to write, this situation will change.</P>
<P>Can Java be used throughout the computer science and engineering curriculum? Probably not yet. There are few college-level textbooks for Java that can target specific courses in computer science and engineering. We see a market for new books here.</P>
<P>Is Java suitable for writing large programs? The problem is Java’s fragile base classes. Imagine if an include file, such as <B><stdio.h></B>, had to be changed. Makefiles across the UNIX operating system would have to recompile a large percentage of the code. Perhaps if developed libraries could be held stable during the course of development, Java could then be used to write large programs. Their maintenance, however, may prove impractical.</P>
<P>What are the drawbacks in being an early adopter of the Java technology? When we begin a trek into a new technological frontier, we must be willing to invest blood, sweat, and code. Programming is a humbling process. We have been writing code for many years, and programming in Java has meant recoding any previous work that we wanted to use. It has also meant having to deal with buggy beta compilers and spending many long and frustrating hours trying to get the answers to simple questions. It has meant being the first on the block to program in a new language. In some sense, this may isolate workers from one another. We have seen people take our Java courses and attempt to transfer the technology to their companies. Management can be slow on its feet, and some people are resistant to change. Perhaps the greatest drawback of being an early adopter of Java is the risk of being a boat-rocker. Go ahead and rock away!</P>
<P>In this chapter we compared the Java model with the HTML model. The basic question is, “Which will win?” As of this writing, the jury is out. Few, if any, decoders exist in pure Java, primarily because the Java API is impoverished. It can read only one audio format (monophonic, 8KHz, 8-bit, Sun AU files). This is a voice-grade audio file with about 48dB of signal-to-noise ratio (SNR) and a maximum frequency response of 4KHz. Compact disc recordings (CDs) are typically stereo 44.1 KHz with 16-bit samples (22.05 KHz cutoff with 96dB SNR). The Java API does not have a method for saving AU files. Furthermore, Sun does not advertise an API for manipulating the data stream that results from reading the AU files (something that this book addresses).</P>
<P>The Java API, as it currently stands, cannot process image sequences. The Sun API does not have a method for saving image files, another issue that this book addresses.</P>
<P>Sun has stated that there will be a multimedia API in the future but, as of this writing, has not said when that will happen. We have had to write a great deal of support code to make up for the areas where the API is currently lacking.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="029-034.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch02/039-041.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<hr width="90%" size="1" noshade><div align="center"><font face="Verdana,sans-serif" size="1">Copyright © <a href="/reference/idgbooks00001.html">IDG Books Worldwide, Inc.</a></font></div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed --><!-- reference_subfoot = footer --><!-- reference_footer = subfoot --></BODY></HTML><!-- END FOOTER -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -