Full HTML for

Basic foilset Java Language in the Computer Science Curriculum

Given by Geoffrey C. Fox at ADMI Tutorial Duluth Minnesota on June 3 99. Foils prepared June 5 99
Outside Index Summary of Material


Overview of Java features and uses
Teaching Java by example
Details of language features:
  • basic language
  • objects and classes
  • graphical user interface (AWT)
  • multi-threading
  • streams and I/O
  • networking
  • distributed objects (RMI)
  • servlets (CGI)
  • database connection (JDBC)
  • component programming (JavaBeans)
  • additional libraries (packages)
Java for Scientific Computing
Examples of Curriculum using Java

Table of Contents for full HTML of Java Language in the Computer Science Curriculum

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient

1 The Java Language in Computer Science Curriculum Middle School to Graduate Master's Degree http://www.npac.syr.edu/projects/admijune99
2 Abstract
3 NPAC resources
4 What can we discuss / Bring to the table?
5 The language Java
6 Java is an important language in the world
7 Java is also important in computer science
8 Developing Java in the curriculum
9 Another Way of teaching Java
10 The Java Academy Teaching Java by Examples (condensed tutorial version)
11 Java Applets
12 A simple Java applet - Hello World!
13 Displaying your applet
14 Graphics Concepts
15 Graphics Methods
16 Language Basics
17 For Loops (slide from Java Academy)
18 First Programming Lab - Patterns of Shapes
19 Patterns of Shapes
20 Histogram Lab
21 Opinion Poll Lab
22 GUI Events - MadLib example
23 Layouts - Tic-tac-toe gameboard
24 User interface for drawing shapes
25 Animations
26 Java Academy in spring 99
27 Teaching the Java in the traditional way: a compact tutorial view of the Java Language and its Advanced Frameworks
28 Architecture of Java Applets
29 Architecture of Java Applications
30 Java Development Kit (JDK)
31 Java Applications
32 The Simplest Java Application: Hello,World!
33 Java Applets
34 Preparing an Applet
35 The Simplest Java Applet: Hello, World!
36 Displaying your applet from a Web page.
37 Multi-tier Architecture
38 Java vs. JavaScript
39 Resources for the Java Programming Language
40 Some of the 1000 Textbooks
41 Java Language Basics
42 Types
43 Example of basic language syntax
44 Object Model Overview
45 Class definition
46 An example of a class definition
47 Inheritance (the subclass relationship)
48 Access control
49 Classes are used as program modules
50 Packages
51 Using objects from Java packages
52 Exceptions
53 Data Structures
54 Abstract Windowing Toolkit (AWT)
55 Basic components
56 Event Model - I
57 Event Model - II
58 Layout Managers
59 Additional Capabilities of the AWT
60 Multi-threading is built into the VM
61 Introducing Threads
62 Synchronization of threads
63 More about synchronization
64 Streams
65 I/O with Streams
66 Network Connections with URL's
67 Sockets for Network Communication
68 Java Application Servers
69 Remote Method Interface (RMI)
70 RMI Architecture
71 Java Web Servers/Servlets
72 Java DataBase Connection (JDBC)
73 JDBC Architecture
74 Connecting to the Database
75 Database queries
76 JavaBeans
77 Features of JavaBeans
78 Component Programming with JavaBeans
79 Using Java for Scientific Computing
80 The Java Grande Forum
81 Activities of Java Grande Forum I
82 Activities of Java Grande Forum II
83 New "Internetics" Curriculum
84 Graduate Certificates
85 CPS606 Programming for the Web
86 CPS616 Advanced Web Technologies
87 CPS640: Networking and Multimedia Technologies
88 CPS714 Case Studies in Information Applications

Outside Index Summary of Material



HTML version of Basic Foils prepared June 5 99

Foil 1 The Java Language in Computer Science Curriculum Middle School to Graduate Master's Degree http://www.npac.syr.edu/projects/admijune99

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Geoffrey Fox,
Nancy McCracken
Northeast Parallel Architectures Center
at Syracuse University

HTML version of Basic Foils prepared June 5 99

Foil 2 Abstract

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Overview of Java features and uses
Teaching Java by example
Details of language features:
  • basic language
  • objects and classes
  • graphical user interface (AWT)
  • multi-threading
  • streams and I/O
  • networking
  • distributed objects (RMI)
  • servlets (CGI)
  • database connection (JDBC)
  • component programming (JavaBeans)
  • additional libraries (packages)
Java for Scientific Computing
Examples of Curriculum using Java

HTML version of Basic Foils prepared June 5 99

Foil 3 NPAC resources

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Latest taught version of classes
Collection of Java resources including examples, tutorials, the Java API (language definition) and outside links:
This tutorial http://www.npac.syr.edu/projects/admijune99

HTML version of Basic Foils prepared June 5 99

Foil 4 What can we discuss / Bring to the table?

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Teaching Java at middle and high school level
Teaching Java and many related Web and distributed object technologies at undergraduate, graduate and professional training level
Internetics Curriculum capturing interface between distributed information and computing technology and applications -- from Internet commerce, distance education to world wide computing
Technology and experience in interactive distance education in partnership with other organizations
Rich electronic curricula available on Web or CDROM
Linkage to Supercomputing with NCSA Alliance and Java Grande Forum

HTML version of Basic Foils prepared June 5 99

Foil 5 The language Java

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
What is Java?
  • A simple, object oriented, distributed, interpreted, robust, safe, architecture neutral, portable, high performance, multithreaded, dynamic language.
Java is interesting because
  • It is both a general purpose object-oriented language along the lines of C++
  • and it is particularly designed to interface with Web pages and to enable distributed applications over the internet.
The Web is becoming the dominant software development arena; this will drive Java as the best supported, most widely taught language

HTML version of Basic Foils prepared June 5 99

Foil 6 Java is an important language in the world

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The Java Language has several good design features
  • secure, safe (wrt bugs), object-oriented, familiar (to C C++ and even Fortran programmers)
Java has a very good set of libraries covering everything from commerce, multimedia, images to math functions (under development at http://math.nist.gov/javanumerics)
Java has best available electronic and paper training and support resources, growing labor force trained in Java
Java is rapidly getting best integrated program development environments
Java naturally integrated with network and universal machine supports powerful "write once-run anywhere" model

HTML version of Basic Foils prepared June 5 99

Foil 7 Java is also important in computer science

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Increasingly, Java is the language used for important computing paradigms that support applications: object-oriented computing, event-driven computing, distributed objects, linkage to databases, visual/component computing, client/servers, networking, multimedia computing . . .
So Java is an important language to include at an advanced computer science level, along with other languages such as C++, that are useful to students to get jobs.
But the good design features of Java also make it suitable for teaching basic computer science concepts: algorithms, data structures, software design, . . .

HTML version of Basic Foils prepared June 5 99

Foil 8 Developing Java in the curriculum

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
At NPAC, our interests in distributed applications and Web computing led us to start teaching Java as just one of the Web applications soon after Java was adopted by major companies in December 1995 (in the class CPS616 in the spring of 1996).
As Java increased in importance, more and more web technologies were based on the Java framework. Now we teach Java (and web architecture) in an introductory course on web programming(the class CPS606), while the class CPS616 discusses some 6 or 7 major web technologies, most of which are based on Java in some way.
Our teaching of Java in these courses has been the traditional computer science way - go through each aspect of the language in order. We illustrate this in the second part of the talk.

HTML version of Basic Foils prepared June 5 99

Foil 9 Another Way of teaching Java

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The traditional way to teach the language Java assumes that students already know programming concepts and are motivated to learn Java. One covers all aspects of each language feature in an orderly fashion. All (that I know of) Java textbooks are written in this way.
We are now teaching Java for middle/high school students and have developed what we think is an better method for teaching Java that should also be suitable for some undergraduates. It is based on a sequence of motivating examples, starting with graphics for visually-based programs, and progressing through more advanced concepts.
Language features are taught as they are required within the examples. And no effort is made to thoroughly cover every aspect of a feature that is not required at that time.
Template programs are given for more advanced features that need only be understood loosely the first time.
The art of this style of teaching lies in choosing examples that are interesting, but that use a minimal progression of features.

HTML version of Basic Foils prepared June 5 99

Foil 10 The Java Academy Teaching Java by Examples (condensed tutorial version)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java is the most social language ......
"Hello World" in Java can be shared with student's peers while
printf in C gives a dull piece of paper ..........
Important to motivate students in their first language by an application they understand
Java is a better first language than Pascal or C++

HTML version of Basic Foils prepared June 5 99

Foil 11 Java Applets

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
We start by explaining that ....
There are two types of Java programs: applets and applications
A Java applet lives on the web and runs inside an ordinary web browser window
A Java application runs on any machine with a Java interpreter installed
In the Java Academy, we concentrate on applets...

HTML version of Basic Foils prepared June 5 99

Foil 12 A simple Java applet - Hello World!

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
import java.awt.Graphics;
public class HelloApplet extends java.applet.Applet
{ public void paint (Graphics g)
{ g.drawString("Hello World!", 5, 25);
}
}
The import statement allows the use of Graphics methods
The paint method uses graphics methods like drawString to draw objects on the window
You name the applet here.
The applet is a program with methods, like paint, that are called by the browser to draw in the window. This applet displays the string "Hello World!"

HTML version of Basic Foils prepared June 5 99

Foil 13 Displaying your applet

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Here is an HTML file with an applet tag to display the results of drawing the applet. First compile the file HelloApplet.java and then run the browser on this html file.
The students had a JavaEdit (public domain edit/compile environment) program that made this easy.
<html><head>
<title>Simple Hello Page</title>
</head>
<body>
My Java applet says:
<applet code="HelloApplet.class" width=150 height=25>
</applet>
</body></html>
Name of your applet class.
The browser will use a rectangle of width 150 pixels and height 25 pixels to display the applet within the other html.
We made a Java Version

HTML version of Basic Foils prepared June 5 99

Foil 14 Graphics Concepts

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Think of a Java applet as a graphics window on which to draw text and other objects
The graphics window has a particular width and height as specified in the <APPLET> tag
The origin is in the top left-hand corner of the graphics window: the x-coordinate increases from left to right, while the y-coordinate increases from top to bottom

HTML version of Basic Foils prepared June 5 99

Foil 15 Graphics Methods

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
There are graphics methods to draw lines, arcs, ovals, rectangles and other shapes. Here is one example:
The drawRect(...) method draws a rectangle anchored at point (x,y): public void drawRect( int x, int y, int w, int h );

HTML version of Basic Foils prepared June 5 99

Foil 16 Language Basics

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
For the class, we have some basic simple slides to show
  • what is a computer
  • variables
  • types int and String
  • assignment
  • arithmetic
  • order of execution
All these are on the Web (go to http://www.npac.syr.edu/projects/k12javaspring99 )

HTML version of Basic Foils prepared June 5 99

Foil 17 For Loops (slide from Java Academy)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A loop statement tells the computer to execute a set of instructions many times, and is controlled by the loop variable.
int sum, num;
num = 8;
sum = 0;
for ( int i = 0; i < num; i++ )
{
sum = sum + i;
}
repeat loop 8 times and
add 1 to i each time
The body of the loop is repeated. Values of i each time around the loop:
i is 0
i is 1
i is 2
. . .
i is 7
What is the value of sum at the end?

HTML version of Basic Foils prepared June 5 99

Foil 18 First Programming Lab - Patterns of Shapes

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
import java.applet.Applet;
import java.awt.*;
public class Pattern extends Applet
{ public void paint( Graphics g )
{
// The variable x represents where to draw in the x direction (to the right)
int x = 0;
// sets the background to be white and drawing color to be magenta
setBackground ( Color.white);
g.setColor( Color.magenta );
// draw a sequence of 6 circles of size 40, evenly spaced
for ( int i = 0; i < 6; i++ )
{ x = x + 50;
// each circle has y = 20, width and height = 40 pixels
g.fillOval ( x, 20, 40, 40 );
} } }

HTML version of Basic Foils prepared June 5 99

Foil 19 Patterns of Shapes

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The lab is written so that students start with an example. Suggestions are given for students to work with variables and the for loop to produce new patterns. Students are encouraged to be creative with patterns and colors.

HTML version of Basic Foils prepared June 5 99

Foil 20 Histogram Lab

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The lecture material introduces arrays and more on Graphics fonts and colors. The example program uses random numbers to simulate throwing a die and records each "face" in a histogram array. Students extend this example with sums of dice.

HTML version of Basic Foils prepared June 5 99

Foil 21 Opinion Poll Lab

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
In this lab, "if" tests are introduced. The students work more with arrays and graphics. (This student used arcs to produce the pie chart.)

HTML version of Basic Foils prepared June 5 99

Foil 22 GUI Events - MadLib example

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This lab introduces the topic of event programming with buttons and textfields. The students used a simplified applet template that handles events and learned how to put in additional buttons and textfields.

HTML version of Basic Foils prepared June 5 99

Foil 23 Layouts - Tic-tac-toe gameboard

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This lab introduced using a layout to organize a set of buttons into border and grid arrangements. They used this to do magic squares or simple calculators.

HTML version of Basic Foils prepared June 5 99

Foil 24 User interface for drawing shapes

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This lab combined graphics drawing with buttons and textfields to control the drawing. It sets up a standard applet layout for such programs.

HTML version of Basic Foils prepared June 5 99

Foil 25 Animations

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This lab used a template for an animation with a thread to keep redrawing a graphics object in a new location.

HTML version of Basic Foils prepared June 5 99

Foil 26 Java Academy in spring 99

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Taught every Saturday afternoon for 2 hours using Tango Interactive to deliver to Syracuse, Boston, Houston, Starkville (Mississippi)
About 45 minutes lectures; rest programming laboratories with mentor at each site
Note that these students in this particular class varied widely from programming beginners to students who already knew a little Java. So the labs were structured to have activities at various levels.
The labs could not be very complex because the students only had a little over an hour to complete them.
Students understood some programming basics, including event programming and were able to use the template programs for more advanced topics such as animations.

HTML version of Basic Foils prepared June 5 99

Foil 27 Teaching the Java in the traditional way: a compact tutorial view of the Java Language and its Advanced Frameworks

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index

HTML version of Basic Foils prepared June 5 99

Foil 28 Architecture of Java Applets

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
web server
Java code
is compiled
to produce
applet codes,
called bytecodes,
part of web
document
collection
web client, running browser
such as Netscape or IE
executes (restricted)
applet code to display
in browser window
Internet
Browsers (Netscape 2.0/3.0/4.0, HotJava, Microsoft IE ...) supporting Java allow arbitrarily sophisticated dynamic multimedia applications inserts called applets, written in Java, to be embedded in the regular HTML pages and activated on each exposure of a given page.

HTML version of Basic Foils prepared June 5 99

Foil 29 Architecture of Java Applications

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java code
is compiled
to produce
bytecodes
run by Java
interpreter
to produce
results
OR
Java code
is compiled
to produce
native code
run directly
on machine
for better
performance
Java applications are compiled and run on a machine just like any other general programming language such as C/C++. No web server or network are required although Java applications may also use network connections for distributed computing.

HTML version of Basic Foils prepared June 5 99

Foil 30 Java Development Kit (JDK)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The Java compiler and interpreter come in a software package called the Java Development Kit.
The compiler, called javac, produces bytecodes, which is compiled code, not for any particular machine, but for the Java Virtual Machine (VM), and abstract machine definition. Thus the compiled code is architecture independent.
The interpreter, called java, executes the bytecodes for a particular machine. The semantics are carefully specified to be the same on all machines.
There is also a program primarily for debugging, called appletviewer, to view applets, a sort of mini-browser.
Currently in use are two versions:
  • JDK1.1, mature version supported by most browsers
  • JDK1.2, has additional classes, such as swing set for fancier user interfaces, but not yet supported by browsers in common use.

HTML version of Basic Foils prepared June 5 99

Foil 31 Java Applications

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
All Java programs are written into a file with a ".java" extension.
Applications are .java files with a main method which is excuted first.
How to compile and run a Java application (via bytecodes):
  • Run the compiler on a .java file:
  • javac MyProgram.java
  • producing a file "MyProgram.class" of Java bytecodes
  • Run the interpreter on a .class file:
  • java MyProgram
  • which executes the bytecodes

HTML version of Basic Foils prepared June 5 99

Foil 32 The Simplest Java Application: Hello,World!

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Since Java is object-oriented, programs are organized into modules called classes, which may have data in variables and subroutines called methods.
class HelloWorld
{ public static void main (String[] args)
{ System.out.println("Hello World!");
}
}
Each program is enclosed in a class definition.
main() is the first method that is run.
The notation class.method or package.class.method is how to refer to a public method (with some exceptions).
Syntax is similar to C - braces for blocks, semicolon after each statement. One difference: upper and lower case matter!

HTML version of Basic Foils prepared June 5 99

Foil 33 Java Applets

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java applets are classes written in Java which are intended not to run as stand-alone programs (as applications do) but as subprograms of a browser which is already managing a window.
Applets should NOT have main method but rather methods called init, start, paint etc. for displaying on the browser window
Applets are not trusted as a default, so they have several restricitions on running on the client machine
  • no printing or file I/O
  • cannot connect through the network to any machine but its own server
  • any new windows created by the applet have a warning label
One can sign Applets (that is what Tango does) to allow user to give permission for such services

HTML version of Basic Foils prepared June 5 99

Foil 34 Preparing an Applet

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The applet should be run through javac compiler getting a .class file as before: javac MyApplet.java
The resulting file MyApplet.class is then stored in the document collection of a web server (hence has a URL location).
Also create an HTML file (say MyApplet.html) with an applet tag to MyApplet.class.
When the browser loads the .html file, it will also download the .class file and invoke the java interpreter to run the init, start, and paint methods.

HTML version of Basic Foils prepared June 5 99

Foil 35 The Simplest Java Applet: Hello, World!

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java applets are part of the class hierarchy that can call methods to display on a screen (within the browser window). One way to draw on the screen is to call the method drawString from the standard method paint.
import java.awt.Graphics;
public class HelloApplet extends java.applet.Applet
{ public void paint (Graphics g)
{ g.drawString("Hello World!", 5, 25);
}
}
The import statement allows the use of methods from the Graphics class without the dot notation .
The paint method displays a graphics object on the screen - one of the standard methods that takes the place of main for applets.
Puts this as a subclass of Applet.

HTML version of Basic Foils prepared June 5 99

Foil 36 Displaying your applet from a Web page.

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
You should name the file with your applet name, HelloWorldApplet.java, run the compiler (javac), getting a bytecode file HelloWorldApplet.class, which you put in a web directory.
<html><head>
<title>Simple Hello Page</title>
</head>
<body>
My Java applet says:
<applet code="HelloWorldApplet.class" width=150 height=25>
</applet>
</body></html>
Name of your applet class.
The browser will use a rectangle of width 150 pixels and height 25 pixels to display the applet within the other html.

HTML version of Basic Foils prepared June 5 99

Foil 37 Multi-tier Architecture

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Distributed applications on the web naturally have a multi-tier architecture.
Java plays a role at all three levels:
  • Graphical User Interface and client side analysis systems, including visualization
  • Middle layer servers and software integration, including web servers, distributed object servers and other application servers.
  • Less important for backend client software, which may be legacy code.
Middle level servers
Client user interface running through browser
Internet
Internet or proprietary network
Backend computing or databases

HTML version of Basic Foils prepared June 5 99

Foil 38 Java vs. JavaScript

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Despite the word "java" in the name, JavaScript is a different language than Java, albeit with some similarities.
A JavaScript program is written directly into the HTML page, and is executed by the JavaScript intrepeter, so also executes dynamic web page content in the browser window.
JavaScript is special purpose - it is an object-based language that deals directly with browser entities such as windows, textfields, forms, frames and documents.
JavaScript can respond to browser events such as mouse clicks and user-typed text.
JavaScript is easy and fast to write, but not as powerful as Java.
Client side with dynamic HTML, JavaScript can be more effective than Java

HTML version of Basic Foils prepared June 5 99

Foil 39 Resources for the Java Programming Language

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The original resource was The Java Language Specification by Sun Microsystems, Inc., March 1995 updated to October 1995 but superceded by
  • The Java Programming Language, by Ken Arnold and James Gosling, 2nd edition, Addison-Wesley, 1998.
http://www.javasoft.com web site has plenty of references including

HTML version of Basic Foils prepared June 5 99

Foil 40 Some of the 1000 Textbooks

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
We have used these books for course textbooks
  • core Java, by Gary Cornell and Cay S. Horstmann, Sunsoft Press, Prentice-Hall, offers detailed coverage of the whole language and packages for advanced programmers. Also Volume 2 gives good coverage of advanced topics such as JDBC, RMI, JavaBeans and security.
  • Java, How to Program, by Deitel and Deitel, Prentice-Hall, starts with beginning programming concepts and progresses rapidly through Java language. It has the most programming exercises and also has companion teaching multimedia books.
We can also recommend a reference book
  • Java in a Nutshell, by David Flanagan, is the language reference book in the familiar O'Reilly series. The 2nd edition of this book omits many examples from the first edition to make room for large section on JDK 1.1.
  • See Also Java Examples in a Nutshell.

HTML version of Basic Foils prepared June 5 99

Foil 41 Java Language Basics

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java syntax has many similarities to C and C++.
Some differences
  • No malloc or free - it has automatic garbage collection.
  • No pointers - designers felt pointer arithmetic not robust or safe.
  • Can declare variables almost anywhere as needed.
  • No struct, union, enum, typedef from C- it has classes and objects instead.
  • Primitive types for integers and floats have machine independent semantics.
  • Booleans in Java have value either "true" or "false" (not 0,1,...).
Some similarities
  • All variables must be declared
  • Syntax and comments
  • Control structures: if, while, and for statements, expressions

HTML version of Basic Foils prepared June 5 99

Foil 42 Types

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A variable is either a primitive type such as int, float or double, or it is an object.
Arrays are objects, but have a special syntax for creating and indexing, more like C and C++.
  • int states [ ]; declares the states variable to be a 1D array of ints
  • states = new int [ 128 ]; creates the new 1D array of length 128
  • states [ 27 ] = i + 1; assigning to an element
Multi-dimensional arrays are arrays of arrays
  • char states [ ] [ ] = new char [12 ] [ 24 ]; delaring and creating at the same time
  • they can also be "ragged"
Arrays can have values that are any type of object
  • Color hues = new Color [ 1024 ];

HTML version of Basic Foils prepared June 5 99

Foil 43 Example of basic language syntax

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
public class SumArray
{
public static void main (String[] args)
{ // array declaration
int a[ ] = new int[10];
int total=0;
/* initialize a - note the use of array instance variable length */
for (int i = 0; i < a.length; i++)
{ a[i] = i * 5; }
/* sum the array */
for (int i = 0; i < a.length; i++)
total += a[i];
System.out.println( "\n" + "The sum of the array is " + total + "\n");
}
}
Familiar C operators ++ and +=
String catenation

HTML version of Basic Foils prepared June 5 99

Foil 44 Object Model Overview

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Programs are composed of a set of modules called classes. Each class is a template specifying a set of behaviors on the data of the class.
Each class has instance variables to hold the data and methods (called functions or procedures in other languages) to define the behaviors. Each object in a program is created as an instance of a class. Each class instance has its own copy of the instance variables.
Classes can be used for data encapsulation, hiding the details of the data representation from the user of the class (by marking variables as private).
Instance
Variables
Methods

HTML version of Basic Foils prepared June 5 99

Foil 45 Class definition

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The class definition consists of
  • a header line giving the class name, modifiers, possible subclass and interface structure
  • declarations (and possibly initializations) of instance variables
  • declaration of a constructor method. This method has the same name as the class and does any initialization whenever an instance is created.
  • declarations of other methods.to perform operations using the data in the instance variable of the class

HTML version of Basic Foils prepared June 5 99

Foil 46 An example of a class definition

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
public class FAstate extends otherClass implements someInterface { // instance variables private int state; //constructors public className ( . . . parameters . . . ) { . . . initialize instance variables (perhaps with parameters) . . . } // other method declarations public int getState ( ) { return state; } public advanceState ( int inc ) { . . . Change the state, using parameter inc . . . } }

HTML version of Basic Foils prepared June 5 99

Foil 47 Inheritance (the subclass relationship)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
In the Java class header, we put B extends A which means B is a subclass of A, if B has all the variables and methods of A (and more).
In the class definition of B, the child class, there is no need to repeat declarations of variables and methods of A, they are assumed to be there. The definition of B has the additional variables and methods of B.
Or B may give a new definition of some method of A. This is called overriding.

HTML version of Basic Foils prepared June 5 99

Foil 48 Access control

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The modifiers in the class head control how other classes can access this one:
  • public -- May be used by code outside the class package
  • private -- this class can only be used within current file
  • friendly(i.e. empty ClassModifier) -- class can be used only within current package (directory)
  • protected -- Only accessible to subclasses
These modifiers are also used for access control to the instance variables and methods.
There are other modifiers. For example, a static variable or method only has the same value for all instances of the class. A final variable cannot be assigned to (used for constants).

HTML version of Basic Foils prepared June 5 99

Foil 49 Classes are used as program modules

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Some classes, such as our hello application, have just one or more method that will be executed as a program. Only one instance of these classes is created (by the interpreter).
Other classes are used to structure data, such as the previous example. Another example might be to have a class to represent type Complex. It would have
  • variables to hold the real and imaginary parts of each instance
  • a method called Complex to initialize those variables on creation
  • methods called add, subtract, and so on to operate on each instance of the complex class.
A computational class could create several instances of the class Complex and use them with the methods for arithmetic.
Note an object carries a lot of "baggage" compared to a simple type. We are trying to get efficient lightweight classes into language

HTML version of Basic Foils prepared June 5 99

Foil 50 Packages

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A package is a collection of classes.
Java directly associates the names of classes and packages with the directory (folder) structure:
  • A package must in be a directory or folder of that name
  • A public class must be in a file of that name. Note that a file may contain other (non-public) classes.
Packages of classes may be defined by users as well as forming the structure of the remaining Java libraries.
What we have seen so far is all there is to the base language Java (with the exception of Exceptions and Threads!). All of the rest of Java functionality comes as classes defined in packages that come with the language. Even for threads and exceptions, much of power is Java runtime support.
Java runtime or Java VM on a given machine is library that supports Java functionality

HTML version of Basic Foils prepared June 5 99

Foil 51 Using objects from Java packages

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Suppose that you want to use two Buttons in an applet. The Button class is in the package java.awt. java.awt.Button b1 = new java.awt.Button( "label" ); All objects created this way are represented internally as references.
Or you can more succintly use the import statement to open the context of the package java.awt:
import java.awt.*;
public class MyApplet extends java.applet.Applet
{ public void init ( )
{ Button b1 = new Button ( "start");
Button b2 = new Button ( "stop");
. . .
}
}
This calls the class constructor method Button to create the new instance and initialize the label .

HTML version of Basic Foils prepared June 5 99

Foil 52 Exceptions

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Exceptions are run-time errors that may arise
  • divide by zero
  • opening a file that doesn't exist
They are handled with try and catch blocks: try { some code that may generate an exception } catch (Exception ex) { some code to handle this case }
Exceptions are described by objects which are instances or subclasses of the class Exception. You may create your own.
You don't have to handle all run-time exceptions such as divide by zero and array index out of bounds.

HTML version of Basic Foils prepared June 5 99

Foil 53 Data Structures

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java has classes for a rich set of data structures.
  • Once arrays are created, they cannot change size. But the class Vector can increase and decrease in size by adding and deleting elements.
  • Strings cannot be changed at all once they are created. The Stringbuffer class does allow one to change the contents in place.
  • The class HashTable creates a structure that maps keys to values.
  • A subclass of HashTable is Properties, which can create and manipulate property lists.
  • There is a class Stack for traditional stack structures.
  • There are classes for Dates and Calendars.
  • There are classes StringTokenizer and StreamTokenizer which usefully parse strings or streams to take out floating point numbers and identifiers as single entities.

HTML version of Basic Foils prepared June 5 99

Foil 54 Abstract Windowing Toolkit (AWT)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This package contains all the classes to create graphical user interfaces.
It allows some primitive drawing (in a subpackage called graphics).
It has a number of components corresponding to parts of a windowing interface
  • basic components like buttons, textfields, lists, scrollbars, etc.
  • components such as panel and frame which allow you to place a number of other components within them. This is hierarchical.
There are layout managers to help arrange the components.
There are events and a model to handle events that come from user interactions such as clicking a button or typing in text.
  • import awt.*;
  • and import awt.event.*;

HTML version of Basic Foils prepared June 5 99

Foil 55 Basic components

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
For each basic component, one can create one or more instances of the component type and then use one of the "add" methods to place it into a Container such as an applet window.
  • Button button1 = new Button("Click here");
  • add (button1);
  • TextField tf = new TextField(Iinitial text", 30);
  • add(tf);
For each basic component, additional methods allow access to the properties of the components:
  • button1.setBackground (Color.cyan);
  • text which is displayed can be changed:
  • tf.setText("now show a new text");
  • If the user types input into the text field, it can be obtained:
  • stringvar = tf.getText();
Click here
Initial text

HTML version of Basic Foils prepared June 5 99

Foil 56 Event Model - I

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The user can interact with the GUI on many of its components, by clicking a button, typing in text, etc. These actions cause an Event to be generated, which will be reported by the system to a class which is an Event Listener, and which will have an event handler method for that event. This method will provide the appropriate response to the user's action.
An Event Listener is an instance of any class that wants to receive events.
An event source is an object that generates events.. An event source will keep a list of event listeners who want to be notified for particular events.
  • button1.addActionListener ( eventclass );

HTML version of Basic Foils prepared June 5 99

Foil 57 Event Model - II

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The event source notifies event listeners by invoking a particular method of the event listener (aka the event handler method) and passing it an Event object, which has all the information about the event.
  • public class EventClass implements ActionListener
  • {
  • public void actionPerformed ( ActionEvent ev )
  • {. . . put code here to respond to event ev . . . }
  • }
Each basic component has a defined Event class, Listener interface, and event handling method names.
Note that an interface is a class in which there are headers of methods with no method body. It just gives the name(s) of methods such as actionPerformed that the user is to provide.

HTML version of Basic Foils prepared June 5 99

Foil 58 Layout Managers

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The various panels in a container are laid out separately in terms of their subcomponents
The arrangement is controlled by general strategies which are embodied in 5 LayoutMangers
To create a layout, such as FlowLayout, in your panel:
  • setLayout(new FlowLayout());
  • This particular Layout is the default and flows in the components in the order that the add method is called.
Other Layout Managers:
  • GridLayout - a regular rectangular grid (table)
  • BorderLayout - 5 areas as in diagram
  • GridBagLayout - general arrangement of space
  • CardLayout - card panels replace each other in the same space.

HTML version of Basic Foils prepared June 5 99

Foil 59 Additional Capabilities of the AWT

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The AWT has many additional capabilities. It can create separate windows either in the form of frames or dialog boxes.
  • Frames have menubars, with menus
  • One can dynamically make frames appear and disappear.
The "swing" set has more advanced features such as internal frames, dynamically sized tables, trees, color choosers, overlapping components, progress bars, popup menus and many other sophisticated user interface elements.

HTML version of Basic Foils prepared June 5 99

Foil 60 Multi-threading is built into the VM

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Both the Java language and its runtime have built in threads which are extensively used
Threads are "light-weight" processes (unlike UNIX processes), which communicate by a combination of shared memory and message passing
  • This communication mechanism is employed naturally by Java
Java threads are limited and for those coming from an HPCC background, we note Java threads have no immediate support for some key parallel computing concepts such as distributed memory (threads running in separate operating system instances)
Java threads are based on a locking mechanism using monitors for synchronization, introduced by Hoare in 1974

HTML version of Basic Foils prepared June 5 99

Foil 61 Introducing Threads

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
One way to create threads is to write a separate class that subclasses the Thread class.
The main line of execution is put in a method called run(), which overrides the method of the same name from the Thread class.
Instances of this subclass are created like this:
  • MyThread mt = new MyThread( );
Thread control:
  • When the thread is created, it does not automatically start running. The class that creates it must call the Thread method start(). mt.start ( );
  • Other methods may be called: Thread.sleep( ), Thread.yield( ), suspend( ), resume( ), stop( ), and join( ).

HTML version of Basic Foils prepared June 5 99

Foil 62 Synchronization of threads

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
In Java, two threads can communicate by accessing a shared variable (shared-memory model).
If two threads can both modify an object, that is, they can both execute a method that assigns to a shared variable, then the modifications must be synchronized.
This is easy - just declare the method to be synchronized!
This means that Java will ensure that only one thread executes the method at a time and is not interrupted.
Suppose more than one thread has an instance of an account:
  • public class Account
  • { int bankBalance; ...
  • public synchronized void CreditAcct(int amt)
  • { ... bankBalance += amt; ... }}

HTML version of Basic Foils prepared June 5 99

Foil 63 More about synchronization

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Often, one thread is producing some data, while another thread wants to use it.
A flag variable is introduced that both threads can check.
If the data is not ready (flag is false), the consuming thread can call the method wait ( ), which causes it to be suspended until some other event occurs.
When the producing thread has some data, it can set the flag to be true and call the method notify ( ), which causes an event that will "wake up" one of the suspended threads.
If the user doesn't get the logic right, there are possibilities for deadlock or other forms of non-progress.

HTML version of Basic Foils prepared June 5 99

Foil 64 Streams

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A stream is a sequence of bytes or characters.
All types of streams are treated similarly, but may have different stream sources and sinks:
  • files
  • network connections
  • blocks of memory
  • threads
The most basic byte streams are InputStream and OutputStream. These classes have methods that can read or write a byte from or to a stream:
  • int read();
  • void write( int );
  • skip( long ); available(); flush(); close();
All of the above methods throw a possible IOException.
The read() and write( int ) methods "block" during transfer.

HTML version of Basic Foils prepared June 5 99

Foil 65 I/O with Streams

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
To read and write text, numbers, etc., you layer various filters on top of the basic input and output streams. These classes have additional methods to read and write data, both ascii and binary.
For example, reading lines of text from a file:
  • BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( "filename.txt" ) ) ); while (( line = in.readLine() ) != null ) { buffer.append ( line + "\n"); } in.close ( );
Buffer
Break into lines
Read bytes from file

HTML version of Basic Foils prepared June 5 99

Foil 66 Network Connections with URL's

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A Java application can create and use URL's to anywhere; applets are restricted to URL's to their own web server.
  • String urlStr = "http://www.npac.syr.edu/"; try { URL url = new URL( urlStr ); } catch ( MalformedURLException e ) { System.err.println( "Bad URL: " + urlStr );}
A method URL.openConnection() returns an instance of class URLConnection:
  • URLConnection conn = url.openConnection();
  • conn.connect(); // open a connection
  • Now use this URLConnection object to open a stream:
  • new InputStreamReader( conn.getInputStream() ) );
Applications can also use conn.getOutputStream(), but not applets.
Note that one can connect not just to HTML files but also to CGI scripts and other web documents.

HTML version of Basic Foils prepared June 5 99

Foil 67 Sockets for Network Communication

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
A java applet, which is downloaded from a web server host, can connect via a network socket to any port on the same machine. This could be a java application acting as a server.
Java applications can connect network sockets to any host machine on the Internet
  • Socket t = new Socket("internet host name", port)
  • sockets have methods to open input and output streams
web server host machine
browser
Applet is downloaded
from web server
applet
Internet
80
nnnn
web
server
Java
application
Socket based on
TCP/IP protocol

HTML version of Basic Foils prepared June 5 99

Foil 68 Java Application Servers

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
web server
host machine
applet
Internet
nnnn
Java
application
Sockets
applet
Java
application
Java
application
Java application acting as a server
A Java application can open sockets to any number of clients
Again, note that socket communication is via streams, where the client and server agree on a message protocol to communicate .
Applets and applications acting as clients

HTML version of Basic Foils prepared June 5 99

Foil 69 Remote Method Interface (RMI)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java RMI allows the programming of distributed applications across the Internet at a more abstract level than sockets. One Java application or applet (the client in this context) can call the methods of an instance, or object, of a class of a Java application (the server in this context) running on another host machine.
An example of Distributed Object Programming - similar to CORBA, except that CORBA allows the remote objects to be programmed in other languages.
The goal is to make calls to remote methods on the local machine have the same syntax and semantics as local calls.
Local Machine
Remote Machine
Local Java
local method
Remote Java
remote method

HTML version of Basic Foils prepared June 5 99

Foil 70 RMI Architecture

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
One key piece is a server that acts as the network lookup, a naming registry from which the client can get a reference to the remote object (the server).
Another key piece is object serialization. Parameters to and from the remote methods must be sent in a standard encoding across the network.
client
Server with
implementations
of remote methods
Naming registry
RMI
RMI
RMI
Calls to methods in the remote object may pass parameters and receive results

HTML version of Basic Foils prepared June 5 99

Foil 71 Java Web Servers/Servlets

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java is now being used to develop web servers.
Java is also being used as the language to develop server side code for web servers, using the Common Gateway Interface (CGI) of the HTTP protocol. These are called servlets.
  • Servlets follow a standard servlet API defining the interface between the server and the servlet, and are designed to work within the request/response model of HTTP. The servlet API is part of the standard extensions of JDK.
  • Servlets can provide all the services of standard CGI, but are platform-independent, i.e. they can be used with any server implementing the API, and have more state capabilities.
  • More generally, servlets play the role of providing middle-tier services between the client and the back-end applications.

HTML version of Basic Foils prepared June 5 99

Foil 72 Java DataBase Connection (JDBC)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Linkage of databases to Web has both increased functionality of web and made databases much easier to use
All the database vendors agreed on a common interface allowing one to write portable database access code
JDBC provides a set of classes for Java with a standard SQL database access interface.
Provides an API for database "drivers" to make actual connections and transactions to database products.
  • includes JDBC-ODBC bridge to standard ODBC drivers, a common interface for relational databases from C
JDBC is "low-level" interface, calling SQL commands directly but is meant to be a base for higher-level interfaces.

HTML version of Basic Foils prepared June 5 99

Foil 73 JDBC Architecture

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Java application or applet with JDBC
Java applet or
HTML browser
Application Server (Java)
with JDBC
Jdbc Driver
DBMS
Two-tier Model
Jdbc Driver
DBMS
Three-tier Model
DBMS Proprietary Protocol
DBMS Proprietary Protocol

HTML version of Basic Foils prepared June 5 99

Foil 74 Connecting to the Database

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The JDBC API is in the package java.sql.
The classes include a DriverManager that keeps track of available database drivers. Download the driver you want and use it to connect to the database server.
Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection ("jdbc:oracle:thin:@carver.npac.syr.edu:1521:europe", "dbusername", "dbpassword");

HTML version of Basic Foils prepared June 5 99

Foil 75 Database queries

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
There are several classes for making SQL statements.
  • Statement stmt = conn.createStatement( ); ResultSet rs = stmt.executeQuery("select a,b,c from table1");
The query returns a result set, which has database table rows satisfying the query.
  • while (rs.next( )) { //print values for current row int i = r.getInt("a"); double f = r.getDouble("b"); String s = r.getString("c"); System.out.println("row" + i + f + s); }
SQL statements may insert, update and delete, and may execute stored procedures in the database. Additional classes deal with transaction commit and rollback.

HTML version of Basic Foils prepared June 5 99

Foil 76 JavaBeans

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
"Reusable software components that can be manipulated visually in a builder tool."
They are Java's implementation of "component-based" visual programming
This modern software engineering technique produces a new approach to libraries which become a "software component infrastructure(SCI)"
There is a visual interface to discovery of and setting of values of and information about parameters used in a particular software component
JavaBeans uses the event model of JDK1.1 to communicate between components

HTML version of Basic Foils prepared June 5 99

Foil 77 Features of JavaBeans

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index

HTML version of Basic Foils prepared June 5 99

Foil 78 Component Programming with JavaBeans

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
The visual interface allows inspection of and implementation of both individual beans and their linkage (events) . This visual construction of linkage allows one to form nontrivial programs with multiple communicating components
A Java Bean component can be a simple GUI component such as a Button or a complex program with many properties and methods such as a spreadsheet.
Apart from the event mechanism used for communication and linkage, ComponentWare (and JavaBeans in particular) "just" give a set of universal rules (needed for interoperability) for rather uncontroversial (albeit good) object-oriented and visual programming practices

HTML version of Basic Foils prepared June 5 99

Foil 79 Using Java for Scientific Computing

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
HPCC is a small field and Scientific Computing a modest size field with limited resources for very hard problems and must leverage as much software as possible
Web Software provides an excellent pervasive user interface with Java Applets and WebWindows
Web Software provides a potentially excellent high performance object oriented language (Java) for scientific and engineering computation
All(!?) we need to do is to add high performance and special features of scientific computing (math libraries) to the Web!
Technology for generating parallelism (user decomposition, parallelizing compilers) not provided by web and must come from HPCC

HTML version of Basic Foils prepared June 5 99

Foil 80 The Java Grande Forum

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Encourages and develops the use of Java for
  • High Performance Network Computing
  • Scientific and Engineering Computation
  • (Distributed) Modeling and Simulation
  • Parallel and Distributed Computing
  • Data Intensive Computing
  • Communication and Computing Intensive Commercial and Academic Applications
  • HPCC Computational Grids ........
Java has potential to be a better environment for "Grande application development" than any previous languages such as Fortran and C++
The Forum Goal is to develop community consensus and recommendations for either changes to Java or establishment of standards (frameworks) for "Grande" libraries and services
These Language changes or frameworks are designed to realize "best ever Grande programming environment"

HTML version of Basic Foils prepared June 5 99

Foil 81 Activities of Java Grande Forum I

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Two major working groups promoting standards and community actions
Numerics: Java as a language for mathematics led by Ron Boisvert and Roldan Pozo from NIST
  • Changes in Java controversial handling of floating point which currently has goal of reproducible results but this leads to non optimal accuracy
  • Addition of Complex types or classes
  • Lightweight classes and Operator overloading -- enables implementation of complex as a class
  • "Fortran rectangular multidimensional arrays" -- Java naturally has "arrays of arrays"
  • High quality math libraries with agreed interfaces -- FFT, Matrices, Transcendental functions

HTML version of Basic Foils prepared June 5 99

Foil 82 Activities of Java Grande Forum II

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Distributed and Parallel Computing led by Dennis Gannon and Denis Caromel (INRIA, France)
  • Performance of RMI (Attractive Java distributed object model - "remote method invocation")
  • Performance of Java runtime (the virtual machine VM) with lots of threads, I/O, memory use
  • Parallel Computing interfaces including Java MPI binding
  • Development of universal (condor, Globus, Legion UNICORE WebSubmit ..) Java interface to computing resources -- enables seamless computing (easier than metacomputing!)
Development of Grande Application benchmarks

HTML version of Basic Foils prepared June 5 99

Foil 83 New "Internetics" Curriculum

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
Internetics is an emerging field centered on technologies, services, and applications enabling and enabled by world wide communication and computing grids.
Combination of computer science with information application areas.
Developing certificate program from high school to continuing education.
Middle/high school certificate includes

HTML version of Basic Foils prepared June 5 99

Foil 84 Graduate Certificates

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
We are planning graduate and continuing education certificates with a curriculum of 4 core and 2 electives needed. Some courses are based on existing Syracuse University courses that we have developed.
  • Introduction to Internetics
  • Programming for the Web (CPS606)
  • Web Software Technologies (CPS616)
  • Infrastructure including Networking (CPS640)
  • Computer Science or Application Electives including:
    • Case Studies in Information Technologies (CPS714)
Most of the advanced information technologies now require knowledge of Java, so it is a required basic course.

HTML version of Basic Foils prepared June 5 99

Foil 85 CPS606 Programming for the Web

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
CPS606 - Computational Methods for Distributed Information Systems (aka Programming for the Web)
  • The goal of this course is to teach students the basic programming skills and languages that are needed to implement distributed Web applications. Coursework will include a short programming module on CGI scripting in Perl and a more lengthy module on programming the Java applet interface to the World Wide Web. Java networking and distributed computing will also be covered. Background material on Web architecture and networking will be included. Prerequisite: Computer programming in some language such as C or C++.

HTML version of Basic Foils prepared June 5 99

Foil 86 CPS616 Advanced Web Technologies

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
CPS616 Computational Science for Information Applications (a.k.a. Advanced Web and Distributed Software Technologies)
  • This course surveys several software technologies of current interest for use with integrated systems in collaboration, databases, and distributed computing. Specific topics in the course evolve rapidly to include leading edge technologies. Currently included are Web interface to relational databases using JDBC, JavaScript and advanced HTML such as DHTML (Dynamic HTML) for rapid development of user interfaces, the use of CORBA to connect distributed applications, component programming with JavaBeans, and security and commerce software. Some material will be taken from research projects at NPAC. Prerequisite: CPS606 or permission of instructor.

HTML version of Basic Foils prepared June 5 99

Foil 87 CPS640: Networking and Multimedia Technologies

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This course is designed to give sufficient background to enable the Web application programmer to understand functionality and performance issues in the design of a corporate intranet or other distributed system.
Topics include advanced networking systems and applications involving multimedia transfer such as digital video servers.
An example will be the Tango Interactive system, a Java/JavaScript-based collaborative system distributed over the Web, and how to write Java applications for it
Short projects will extend the more basic examples covered to demonstrate the concepts.

HTML version of Basic Foils prepared June 5 99

Foil 88 CPS714 Case Studies in Information Applications

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. *
Full HTML Index
This course highlights a few advanced topics and then students do an in-depth project in one area.
This year (Summer 99) the topics are
  • XML and its applications to portals in business, education and scientific research
  • Distributed Object Security and its application to Internet Commerce, portals, and computing
  • Portals: business intranet, virtual universities, and computational problem solving environments
  • Distributed Object registration and lookup services including LDAP
  • Computing, including web servers and the computational grid

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Jun 5 1999