the Software View: Java, a wonderful brew (Part V)

Mark Kuharich (markk@appmethods.com)
Thu, 21 May 1998 12:40:41 -0700


I have been given permission from Rohit Khare to distribute this to FoRK
Mark Kuharich
JavaBeans developer
http://www.west-point.org/users/usma1990/47414/

Please feel free to forward this newsletter to as many friends as
possible. I have a personal goal of having one million readers. I can
achieve it with your help

the Software View: Java, a wonderful brew (Part V)

Welcome back, gentle reader. I'm hooked on the JavaVision[1] Newsfeed.
Of course, my favorite quote from Issue 20 is "Good analysis is hard to
find and so are good writers. I can remember back far enough, to a time
when Jesse Berst and Esther Dyson would exchange emails with me before
they were both catapulted into prominence. Recently I stumbled across a
newsletter written by Mark Kuharich out of West Point. Mark has a great
many interesting things to say about Java and the industry and I
recommend a subscription to his free newsletter, "the Software View" I
am honored and humbled that my name was mentioned in the same breath as
the preeminent technology pundit, Jesse Berst and the industry's elder
stateswoman, Esther Dyson. I will work long and hard to earn the trust,
that you, dear reader, have placed in me. Please peruse their site at
http://javavision.org

One of my readers, Joe Gilbreth asks, "Mark, for us less technical
types, how about spelling out just how one would go about using the
existing Java apps. What would one have to do on a
typical Windows machine? Are the apps you mentioned freeware,
shareware, or what? What would a machine be like that was intended to
run only Java apps? Would any of this be worth doing now, in lieu of
existing applications? Also, are there OSs written in Java? How long
will it take for Windows to be in any real danger from Java apps?" Joe,
in order to use the existing Java applications on a typical Windows
machine, you just need to ensure that a Java virtual machine is
installed on your Windows personal computer. Java virtual machines can
come from many sources: whether it's your currently installed Internet
browser or the JRE (Java Runtime Environment[2]) from Sun. The
applications I mentioned are predominantly commercial versions released
by independent software vendors. An example of a machine intended to
run only Java applications is the hot, new JavaStation[3] from Sun. It
looks sweet. Yes, there are operating systems written in Java. Take a
look at JOS[4]. To answer your question about Windows being in danger
from Java applications. Right now, Windows is in serious danger when
you desire a cross-platform solution. Nothing can beat Java when you
have anything other than a completely Windows-only shop.

Another of my readers, Satish Talim, passed along these two Java
newsletter tips. Please see intelligence.com[5] and Java(TM)
Report.com[6].

Another of my readers, Greg Franklin, passed along two tidbits. One on
Futurist Programming[7] and the other, a Manifesto of Futurist
Programmers[8].

I chuckled when I read that in a public poll[9], by a 5 to 1 margin,
Americans oppose state Attorneys General blocking the release of
Microsoft Windows 98. Of course, Microsoft commissioned and paid for
this poll. The Literary Gazette, during the height of the Great
Depression, surveyed a small sample of residences by telephone and
predicted in 1936 that
Roosevelt would lose by a landslide. He won by a landslide. You never
heard of the Literary Gazette? That's because it went bankrupt the year
after it predicted that FDR would lose big. It was the leading news
magazine of its time. As the quality guru Deming preached, sampling is
everything. During the Depression, only upper class Republicans could
afford telephones, particularly for small samples. And who was sampled
for the Microsoft-paid survey? Would they let us see the sample?

Now, dear reader, on with this week's episode! What is Java[10]?
Java[11], developed by Sun Microsystems, was designed for creating
applets and applications for the Internet, intranets, and any other
heterogeneous, distributed network. This platform offers the following
powerful features. The following examples are not all-inclusive.

Java is simple. Java is similar to C and C++, which many programmers
are already familiar with. Some of the more difficult features of C++,
including pointers and pointer arithmetic, and extensive automatic
coercions, were omitted to make programming with Java easier. A
specific type of multiple inheritance can be written by using the
implements keyword. The Java automatic garbage collection feature
reduces bugs by automatically freeing unused memory. You can explicitly
invoke garbage collection by calling system.gc();

Java is small. Living on the Internet requires that Java be small.
Java applets are relatively small in size, so they can be downloaded
from the Internet and run on computers with little available memory.

Java is object-oriented. Java was object-oriented at its birth and is
object-oriented at its core. It includes extensions from Objective C
for dynamic method resolution. Some advantages of object-oriented
programming include: code is encapsulated in objects, which have a
public interface and a private implementation, so you can rapidly
develop prototypes and group code into manageable chunks - even for very
complex systems. Objects can inherit the characteristics of other
objects and override inherited characteristics, so you can easily reuse
code, make your code more compact, and fix or update code in one place,
which saves time and reduces bugs. I will give you my views of the
difference between creating Windows C++ programs and Java applications.
I should know, I've done both. Creating a Windows C++ program is what I
call the "plum pudding" model of application development. The operating
system is the pudding, and all the applications are the plums resting in
it. The Windows operating system is an essential facility. Every
Windows program takes advantage of underlying operating system calls.
This is why Windows grows bigger every year and why Microsoft can crush
competitors by folding applications like Internet browsers into their
operating system. With Windows, you have to worry about the Windows
System 32 directory, DLL's (dynamic link libraries), aggregation,
marshalling, and monikers. A Java application is what I call the "LEGO
block" model of application development. You only add what you need,
versus the Windows operating system which requires you to have
everything. So, your Java application can be as small or as big as you
wish. You download only the packages you need by using the import
keyword.

Java is network-ready versus Windows which grew up on standalone
personal computers. Creating network connections is easier in Java than
for C or C++ because Java has built-in routines for dealing with TCP/IP,
including HTTP and FTP. These routines make it as easy to open and
access objects over the Internet through URLs as it is to access a local
file system. The java.net package provides classes for network support,
including URLs, TCP sockets, UDP sockets, IP addresses, and a
binary-to-text converter.

Java is robust. Java eliminates problems early by requiring
declarations, using static typing, having the compiler perform type
checks, and not supporting pointers, which can result in overwriting
memory or corrupting data.

Java is secure. Because there are no pointers, Java applications can't
access data structures or private data that they don't have acess to.
This prevents most viruses from taking hold. Applets, when run within a
web browser on a local computer, can't read or write to the disk,
execute programs on this computer, or connect to any other computers
except the web server from which they were downloaded. This is called
the "sandbox" model.

Java is architecture-neutral and portable. The Java compiler generates
an architecture-neutral object file format and bytecode instructions, so
Java code can run on any computer that has a Java runtime system.
Bytecodes are instructions that are similar to machine code, but are not
platform-specific. During execution, the Java virtual machine either
interprets the bytecodes or converts them to machine code. Creating
separate applications for different computer platforms is no longer an
issue. Goodbye to C++ IFDEF's.

Java is high-performance. Java bytecodes can be translated on the fly
to native machine instructions - for example, by a Java enabled browser.
Linking is faster than for C or C++. Once the Java bytecodes are
converted to machine code by a JIT (Just-In-Time) compiler in a Java
virtual machine, the performance is comparable to that of C or C++.
Sun's new Project HotSpot[12] increases performance even more by using
focus optimization, inlining, and adaptive optimization.

Java is multithreaded. Java can deal with multiple things happening at
once with sophisticated synchronization primitives that are integrated
into the language, which makes them easier to use and more robust.
Multithreading improves interactive responsiveness and real-time
behavior, so is critical to high-performance Java applets because applet
execution must continue while various image and binary files are being
retrieved from one or more web servers. In addition, the ability to
control the execution of multiple concurrent threads is crucial for
deploying real-world web applications. All you have to do is Thread
thread = new Thread(); and use the synchronized keyword versus Windows
where you have to implement your own thread manager or use a Windows
message pump.

Java is dynamic. New packages or module plug-ins can be added to a Java
application with minimal overhead. Java can look up a class definition
at runtime from its name versus Windows where you must declare other
modules in header files and then link in those modules at compile time.

Sincerely,
Mark Kuharich

Join my free email newsletter called "the Software View" by sending
mailto:markk@appmethods.com
"the Software View" is archived at
http://www.west-point.org/users/usma1990/47414/markk1.htm

CURRENT VIEWS:
Microsoft J++ show a dud. J++ show quiet on Microsoft front. Microsoft
Corp. long has claimed that cross-platform Java is a myth and developers
really want to write Java applications that take advantage of the
underlying operating system. But the Redmond, Wash., software maker was
hardly packing 'em in last week. About 225 developers showed up for the
first-ever show to promote Microsoft's Java vision and the Visual J++
tool that, to the dismay of Java purists, can help programmers write
Java applications optimized for the Windows operating system. The quiet
user sessions and morgue-like exhibition floor at the Visual J++
Developer Conference were a far cry from the buzz created by 14,000
developers swarming around San Francisco's Moscone Center for Sun
Microsystems, Inc.'s JavaOne show in March. Reports range from capacity
for 2,500 to 20,000. Regardless, only 225 showed up
http://www.idg.net/idg_frames/english/content.cgi?vc=docid_9-53741.html
http://javaconference.com
The conference was scheduled to have 48 sessions, but many of those must
have been empty, given the limited number of participants. The first
JavaOne conference had 4 times this number. The lack of bodies is most
easily explained by the fact that Visual J++ is too narrow
of a subject to warrant this kind of hype. Likewise, Microsoft's
Windows Foundation Classes (WFCs), the Windows' specific classes for
J++, are suffering from narrow support. While the majority of desktops
do support them, Visual J++ is the only tool that developers can use
with WFCs. All of the major Java tool vendors are not adding support
for WFCs. Facts such as these must be reaching the higher echelons of
Microsoft's strategic planning. Their original strategy has been to
leverage the entrenched position of Windows to garner a following for
J++, but as they bang their drum and march off into the woods, the
absence of footsteps behind them has become obvious. Microsoft just
might have to take a conformist stance
http://javausers.ihost.com/jnews/stories.nsf/allarticles/May698.html

Microsoft bug. A Java Servlet using an HttpURLConnection to POST data
to a URL, and read the
result that the Servlet returns
URL url = new URL(http://localhost/servlets/query);
HttpURLConnection urlc = (HttpURLConnection)url.openConnection();
urlc.setRequestMethod("POST");
urlc.setDoOutput(true);
Works fine with the Symantec JVM, but it fails with a ClassCastException
running in IE4. Seems that MS returns an instance of
com.ms.net.wininet.http.HttpURLConnection from the URL.openConnection()
call. To add insult to injury,
com.ms.net.wininet.http.HttpURLConnection is a private class; thus, I
can't call any of the methods in HttpURLConnection, like
setRequestMethod() or setDoOutput()

Direct quotes from Paul Maritz, who was then Microsoft Group Vice
President of platforms and applications, said Netscape Communications
Corp. was using its browser to create a "virtual operating system" that
was "no longer a browser, but an environment." He said if unchecked,
Java "will redefine client/server computing. Windows will become
devalued, eventually
replaceable." One of Microsoft's weaknesses was that it had "no control
over Java," according to Maritz, who proposed a strategy to "catch
Netscape and neutralize Java. Java cannot be an advantage for
Netscape," reads one of the slides. "Get control of, then leverage the
programming model. Extend HTML to leverage Microsoft tools, use COM/OLE
[Component Object Model/Object Linking and Embedding] objects to add
behaviors to client/server and platform, neutralize Java, build identity
around 'Active'."
http://www.zdnet.co.uk/news/ns-3968.html

Security Tradeoffs: Java vs. ActiveX. An Unofficial View from the
Princeton Secure Internet Programming Team. How can ActiveX security
break down? The main danger in ActiveX is that you will make the wrong
decision about whether to accept a program. One way this can happen is
that some person you trust turns out not to deserve that trust. The
most dangerous situation, though, is when the program is signed by
someone you don't know anything about.
You'd really like to see what this program does, but if you reject it
you won't be able to see anything. So you rationalize: the odds that
this particular program is hostile are very small, so why not go ahead
and accept it? After all, you accepted three programs yesterday and
nothing went wrong. It's just human nature to accept the program
http://www.cs.princeton.edu/sip/java-vs-activex.html

We Who Are About to Crash Salute You. Like a Roman emperor looking to
burnish his godlike image among the little people, Bill Gates came to
Manhattan for a bit of bread and circus to drum up support for the
unimpeded release of Windows 98. Bread seems to be the common bond
between the 60 or so industry representatives present and Bill Gates,
who needs only to say "Jump" for them to ask how high. So much for the
clowns; but this circus had little else to offer besides the
self-serving wind Microsoft has been blowing lately. The staginess of
the setting only reinforced the sense of false spontaneity, as one
beholden company after another pledged fealty to Microsoft while
representatives of ProComp, an anti-Microsoft coalition, were asked to
leave the building by security guards. Microsoft's claque spoke of dire
consequences if Windows 98 were not released on time, begging the
question of why the yearlong
delay in the release of Windows 95 had not caused any such problems.
Also untouched was the implication of Microsoft's own argument -- if
holding up the release is such a disaster, isn't that proof that
Microsoft has an undue influence in the industry? After testimonials
from his lackeys, Gates wrapped it up with his standard spiel: That the
government is trying to stop innovation, and hence the consumer's
well-being, which apparently takes precedent over the law. He compared
the compulsory separation of the browser and the operating system to
that of a radio from a car -- bummer, man, but a car doesn't need a
radio to run, right? -- when in fact it's the threat of not having a
motor to put in the car that's won him all this unwelcome attention.
After his command performance love-in, Gates met with Joel Klein, the
lead antitrust prosecutor, for a more down-to-earth discussion of what
might happen if the DOJ goes ahead with its possible new antitrust
action. Neither side would comment on their discussion. [By Jonathan
Gregg]
http://cgi.pathfinder.com/netly/afternoon/0,1012,1966,00.html

PersonalJava for all TCI set-tops. Tele-Communications Incorporated
(TCI) said it has selected the PersonalJava software environment from
Sun Microsystems as its standard language on all of its TV set-top
boxes, including those running Microsoft's Windows CE software, a
momentous decision as the cable giant eyes new interactive programming.
The extension of the agreement also means that Microsoft will have to
ensure that CE works with PersonalJava. "They will have to pass a
compatibility test," he added. "They will have to make sure they do not
trample on any IP [intellectual property]."
http://www.news.com/News/Item/0,4,21869,00.html

LINKS:
[1] http://javavision.org
[2] http://java.sun.com/products/jdk/1.1/jre/index.html
[3] http://sun.com/javastation
[4] http://www.jos.org
[5] http://intelligence.com
[6] http://javareport.com
[7] http://www.sgi.com/grafica/future/index.html
[8] http://www.sgi.com/grafica/future/futman.html
[9] http://www.news.com/SpecialFeatures/0,5,21872,00.html
[10] http://java.sun.com
[11] http://sun.com/java
[12] http://java.sun.com/javaone/sessions/slides/TT01/tt01_43.htm