Java - Whats All The Excitement About?
Mark Volkmann, Object Computing, Inc. (OCI)
Outline
- A new object-oriented language
- used for internet-based applications AND normal applications
- An environment
- toolset, class libraries, security mechanisms
- Compiled for speed
- to produce bytecode which is machine language for an imaginary computer called the Java Virtual Machine (JVM)
- Interpreted for portability
- bytecode is interpreted to native machine code
- bytecode is close to the machine code for real machines
- interpreting bytecode to machine code is much faster than interpreting from source code as is done for JavaScript and Basic
- java interpreter for applications
- appletviewer, Netscape Navigator, or HotJava for applets
- Will be directly supported by most major OSes
- Apple, Hewlett-Packard, Hitachi, IBM, Microsoft, Novell, SCO, Silicon Grahpics, Sun, Tandem
Java Flow
Java Adds Dynamic Content
- Web pages with static content dont change
- ex. pictures of new homes offered by a builder, lists of options, prices
- created with HyperText Markup Language (HTML)
- Pages with dynamic content change
- ex. colors in pictures are changeable, options can be selected, total price and monthly payments for different interest rates ca
- dynamic content includes
- animation
- audio
- graphics (not images)
- keyboard input
- mouse interaction (includes drawing)
- created with CGI, JavaScript, Java,
and plug-ins (ex. Shockwave and VRML)
Common Gateway Interface (CGI)
- One way to achieve dynamic content
- Each CGI script invocation requires a new internet connection to be established
- Work is done on server
- Cannot validate input on client
Web Page Creation
- Past
- HTML
- typical elements
- header, list, link, image, image map, table, frame
- GUI forms
- text entry(single & multiple line), password entry, checkbox, radio button, file selection, option menu, scrolled list, submit b
- CGI
- Future
- HTML
- new authoring tools make this easier
- CGI
- still useful when server-side processing is desired
- JavaScript
- supports simple client-side processing
- Java
- supports complex client-side processing
Origins of Java
- Uses the best features of
- C++ (syntax)
- Objective-C (interfaces)
- Smalltalk & UCSD-Pascal (virtual machine bytecode)
- others (Eiffel, Lisp, Pascal, Cedar, Self, Beta)
- Quote from Arthur van Hoff
(former Sun employee and one of the main members of the Java team)
- We never claimed that Java is new.
It is simply good technology repackaged!
Object-Oriented Benefits
- Better software design
- different way of thinking about software
- software can more closely models real world problem being addressed
- domain experts can more easily participate in initial software design
- Easier to maintain
- problems are easier to isolate
- changes are more localized
- Easier to extend
- easy to make extensions to existing functionality
- Less code to write
- more likely to reuse code from other applications
- more likely to find commercial code (class libraries) that can be used for portions of an application
Sample Java Applets
Features Important for an Internet Language
- Secure
- Portable
- dont have to recompile to run on another platform that has a Java interpreter
- Fast
- compared to scripting languages like Perl, Python, TCL, and JavaScript
- discussed in more detail later
- Simple to release
- dont have to copy to each client machine
- latest version downloaded automatically at run-time
Features Important to Developers
- Object-Oriented (benefits discussed earlier)
- Productive
- faster development cycle since linking is not required
- Familiar
- syntax resembles C and C++
- Garbage collection
- avoids memory leaks
- failing to free memory that will no longer be used
- avoids accessing freed memory
- lack of automated memory management in other languages is a source of memory leaks and bugs
- Extensible
- applications can call functions written in other languages
Aspects of C/C++ That Java Improves Upon
- Time consuming links
- Confusing features
- multiple inheritance
- operator overloading
- templates
- Dangerous features
- unsafe casts between unrelated types
- array access w/o bounds checking
- lack of memory management
- pointer arithmetic
- potential for memory leaks
- potential for overwriting memory
- lack of garbage collection
- Non-OO features
- Prevents applets from
- acting as viruses
- accessing client files --> cannot read, write, rename, or delete a file; cannot create a directory or list file in one; cannot determine a file's existence, type, timestamp, size
- starting processes on the client
- using code written in other languages
- making network connections other than to the applet host
- Security is provided by
- bytecode verifier
- SecurityManager class
- lack of pointer manipulation
- Digitally signed applets
- Sun is working on this
- users would tell their web browser to trust specified digital signatures
- trusted applets would have fewer client-side restrictions
- Java, as it stands today, would not typically be used for computationally intensive tasks or sorting
- about 10 times slower than C
- However, for comparison purposes the following tests were run on a Sun workstation using the Solaris OS
- Bubble Sort
- sorting 6,500 integers
- C++: 33.4 seconds
- Java: 311.3 seconds (9.3 times C++)
- Perl: 1662 seconds (49.8 times C++)
- Math Calculations
- 1.2 million square root and log calculations
- C++: 9.6 seconds
- Java: 27.8 seconds (2.9 times C++)
- Perl: 48.8 seconds (5.1 times C++)
Components of Speed
- The speed of a Java applet has three components
- time to download applet to client
- time to verify bytecode
- execution speed once it is there
- Java applications
- are not downloaded from the internet
- are verified
Ways to Increase Speed Coming Soon
- Download faster
- by increasing speed of internet connection
- Eliminate need to download
- by caching recently downloaded applets at client
- Retain internet connection
- HTTP server keep-alive feature
- HTTP-NG (Next Generation)
- Run faster
- Just-In-Time (JIT) compilers
- coming from many development environment vendors
- 10x to 25x speed increase (near speed of non-optimized C)
- Asymetrix claims 50x speed increase from their flash compiler
- native methods
- native executables
- Process Java bytecode in hardware
- Sun is creating processors to do this
- Free from Sun
- Includes class libraries
- lang, util, io, awt, net, applet
- Includes tools
- javac - compiles Java source files
- java - applications bytecode interpreter
- appletviewer - applets bytecode interpreter
- jdb - line-oriented debugger
- javadoc - generates HTML class documentation
- others - javaprof, javah, javap
- Current version is 1.0.2
Port Availability
- Development environments are not free
- available from Borland, Microsoft (in work), Natural Intelligence, Rogue Wave, Silicon Graphics, Sun, Symantec, and others
- Who has claimed responsibility?
- Sun
- ported to Solaris, Windows 95/NT, and MacOS
- IBM
- ported to OS/2 and AIX
- Windows 3.1 port is targeted for end of 96
- Netscape
- working on a Windows 3.1 Java interpreter (not whole toolset)
- planned to release a version of their browser using it 2nd qtr. 96
- OSF
- working on other UNIX ports including HP-UX and Digital Alpha
- Silicon Graphics (SGI)
- Linux and Amiga ports are available
How Sun Profits
- Java development environment
- Java Workshop
- written in Java for portability
- Licensing Java to software vendors
- necessary to imbed java interpreter into commercial software
- Specialized Java class libraries
- examples
- 3D modeling classes (related to VRML)
- image processing classes
- Expanded market
- increased demand for their internet related hardware and software through name association with Java
- Object persistence
- objects written to a file in such a way that they can be recreated in a later session
- will allow applets downloaded over the internet to be saved locally
- can run next time without downloading
- expected in next release of Java (summer 96)
- Java Database Connectivity (JDBC)
- databases with JDBC support will be accessible from Java applets
- spec. was published for 90-day public comment in March 96
- vendors that have pledged support include Borland, Gupta, IBM, Informix, Intersolv, Object Design, Oracle, RogueWave, SAS, SCO,
- Distributed Objects (CORBA)
CORBA
- Common Object Request Broker Architecture
- utilizes investment in legacy applications and allows integration of new technologies
- interoperability standard which defines an object-oriented framework for integrating distributed applications
- uses Interface Definition Language (IDL) to describe distributed objects
- application objects communicate with each other, and with a standardized collection of object services, through an Object Reques
- Java CORBA products
- access CORBA components from Java code
- implement CORBA components in Java
- current vendors
- Iona Technologies - Orbix for Java
- Visigenic - Black Widow (being renamed)
- SunSoft - Java Object Environment (JOE)
CORBA Depicted
- Inferno and Limbo from Lucent Technologies (Bell Labs) may become a contender
- Currently Javas only serious competition for providing client-side, web-based applications
- from Microsoft
- a development kit composed of specifications and tools for generating internet applications and content
- uses VBScript, OCX (OLE Controls), Visual Basic, Visual C++, and
OLE documents
- OCXs are used to make custom GUI widgets/forms and specify their functionality
ActiveX (Contd)
- Advantages of ActiveX over Java
- graphical GUI builders are available now
- compatible with other Microsoft products through OLE
- allows creation of internet applications that utilize OCXs
- there are a large number of existing commercial OCXs
- Visual Basic developers can utilize their current skills rather than learning a new language and development environment
- Disadvantages of ActiveX relative to Java
- no security
- allows users to determine amount of risk to take
- can access the operating system and memory so can damage client systems
- working on digital signatures but that will be the only security
(when machine gets trashed you will know who did it)
- limited portability
- currently only works under Microsoft OSes
- even when other OSes support it, web servers will have to send OS specific versions to web browsers
- no networking or multithreading support
Progress of New Technologies
- New technologies move through these stages
- Feature
- Function
- fixed (bugs and design flaws)
- Performance
- Java has only recently been delivered
- Abstract Windowing Toolkit (AWT)
is being improved
- Security issues are being resolved
- Performance increases are coming
- Wash. U. Partnership - (314)-935-4444
- Introduction to Java (1 day - $250)
- overview of the Java language and environment
- topics include: OO programming concepts, history, benefits and features of Java, speed issues, JDK class libraries and tools ove
- Java Programming (3 days - $750)
- hands-on instruction in Java programming
- topics include: Java syntax, GUI creation using AWT, graphics and animation, threads
- Advanced Java Programming (3 days)
- starts April 97
- hands-on instruction in advanced topics of Java programming
- topics include: native method, networking, JDBC database access, CORBA
Biggest Reasons to Select Java Over Other Languages
- Web-based application/data access
- common interface to applications/data inside and outside company
- Portability
- applications will run on all major platforms
- Networking
- can access data on other servers using a variety of protocols
- Object-oriented
- software is easier to maintain and extend
- Garbage collection
- software is less prone to errors
- Productivity
- eliminates time to repeatedly link executables during development
Appendix A - Lists
Current Licensees
- Adobe 12/6/95 - incorporating Java support into its PageMill Web authoring software and Acrobat electronic document software
- Borland 11/8/95 - added Java support to their C++ development environment, released a graphical Java debugger, demoed a JIT comp
- IBM 12/6/95 - ported to OS/2 and AIX, working on Windows 3.1 port, incorporating into Lotus Notes, adding Java compiler to Visua
- Macromedia 10/30/95 - incorporating Java into a web authoring tool
- Metrowerks 11/10/95 - adding support for Java to its CodeWarrior C++ development environment
- Microsoft ~3/1/96 - will incorporate into its Internet Explorer web browser
- Netscape 5/23/95 - incorporated into web browser
- Novell - 3/21/96 - allowing Java interaction with NetWare and rewriting many of their tools in Java for portability
Current Licensees (Cont'd)
- Oracle 10/30/95 - incorporating Java into PowerBrowser application framework for accessing applications and documents through ne
- Silicon Graphics - creating Cosmo Code development environment
- Spyglass 11/8/95 - adding Java support to its web browser (Spyglass is a spin-off of NCSA)
- Symantec 12/13/95 - adding support for Java to its C++ development environments (Espresso and Caffeine) and creating Cafe develo
Announced Database Support
- Goal is to eliminate the need for CGI to access databases
- access databases directly from Java code on client
- Borland - Nexus
- provides intranet (company restricted internet) database access
- beta targeted for late 96
- BulletProof - Mocha
- Java Open DataBase Connectivity (ODBC) engine
- Open Environment - Entera
- allows Java programs to access many databases, applications, and legacy systems
Announced Database Support (Contd)
- Sun - JDBC
- databases of vendors who add support for the soon-to-be-published Java Database Connectivity (JDBC) specification will be access
- JDBC uses the communication capabilities of the java.net package
- spec. was published for 90-day public comment in March 96
- vendors that have pledged support include Borland, Gupta, IBM, Informix, Intersolv, Object Design, Oracle, RogueWave, SAS, SCO,
- WebLogic - dbKona
- allows Java applications to access relational databases
- dbKona/T3 allows Java applets to access relational databases
Third-Party Java Classes
- Ice from Dimension X
- a 3D graphics package
- uses a C library accessed through native methods for graphics primitives (not portable)
- NetCharts from NetFactory
- allow non-programmers to display business data on web pages
- $495
- Nutmeg from Thought Inc.
- a class library modeled after the Smalltalk Collection classes
- TEA (The Easy Animator) from Dimension X
- a tool for creating Java animations
- Starwave
- a set of classes supporting regular expression operations
- modeled after Perl
- free
- WebScript from WebLogic
- generates HTML from Java for dynamic web pages
Appendix B - JavaScript
What is JavaScript?
- An object-based scripting language
- syntax is similar to Java
- competing Microsoft product is Visual Basic (VB) Script
- Created by Netscape
- Sun is writing the language definition
- Entered in HTML files
- Netscape 3.0 will allow including from separate files
- Details
- form input fields can be processed on client-side
- functions defined at top of HTML file
- input field event handlers invoke JavaScript functions
- event examples
- changing value, leaving a field, entering a field, clicking, moving mouse over, selecting text, loading page, unloading page
JavaScript vs. CGI
- Advantages of JavaScript over CGI
- can verify that valid values are entered on client machine instead of sending data to a server (speed)
- can set form field values
- can communicate with plug-ins
- Advantages of CGI over JavaScript
- for large amounts of processing it can be faster to run a CGI script written in C on the server
- can access server data
- Some applications will benefit from a combination of JavaScript and CGI
JavaScript vs. Java
- Java has more capabilities
- more complex user interfaces
- animation
- graphics
- separate windows w/ menubars
- dialog boxes
- multithreading
- more control over form layout
- supports network protocols
- Java
- is more difficult to learn
- runs faster
- Neither can write to local hard disk
- this and other restrictions may be relaxed later
Appendix C - Detailed History
History of Java
- Early 90 - Sun programmer Patrick Naughton threatens to leave Sun for Next, Sun chief Scott McNealy asks for solutions to impro
- Spring 90 - Naughton, James Gosling (author of Berkeley UNIX, UNIX emacs, and the NeWS window system; wrote original Java compi
- Spring 91 - Green team starts work on a prototype to control consumer appliances
- August 91 - Green team wants to build an interface to cyberspace, Gosling creates OO language Oak after abandoning C++ for la
- August 92 - demo using Duke to control a VCR shown to McNealy
- October 92 - Sun creates subsidiary FirstPerson to develop and market Oak
- Late 92 - Attempts to market phone and TV oak-based interfaces to Mitsubishi Electric and France Telecom fall through
History of Java (Cont'd)
- Early 93 - Arthur van Hoff and Sami Shaio join FirstPerson
- March 93 - FirstPerson loses bid to provide interactive TV set-top boxes to Time Warner who chose SGI instead, SGI fails to mee
- June 93 - Marc Andreessen and Eric Bina, at U. of Illinois National Center for Supercomputing Applications (NCSA), release Mosa
- Summer 93 - FirstPerson fails to make deal with 3DO
- Spring 94 - FirstPerson dissolves
- Summer 94 - Sun renowned programmer & co-founder Bill Joy and Sun chief technology officer Eric Schmidt gets team to adapt Oak
- December 94 - Oak and WebRunner were made available to a select group on the internet, Andreessen, who had left NCSA for Netsca
History of Java (Cont'd)
- January 95 - Oak renamed Java, WebRunner renamed HotJava, Naughton leaves to start Starwave which creates online services using
- Spring 95 - Arthur van Hoff rewrites javac compiler in Java (new platforms now only need to port the Java interpreter), Sami S
- May 95 - official announcement of Java is made, several alpha and beta versions follow
- August 95 - Netscape becomes first Java customer (rumored to have paid only $750,000)
- January 9, 96 - Sun creates JavaSoft unit
- January 23, 96 - Sun releases Java 1.0
- January 28, 96 - van Hoff, Shaio, & Polese from JavaSoft and Payne from Starwave announce they are leaving to begin a new company
Last Modified: 17 August 1996
St. Louis Unix Users Group - Linux SIG