ISM 3232 - Intermediate Business Programming.

Chapter 0-1 Student Learning Objectives.

You should be able to:

Chapter 0.

Review. You should already be familiar with, and are responsible for, the following concepts in Chapter 0.

What is a computer program?

Why Java?

Supports Internet/WWW applications due to:

Object-Oriented (OO) Programming

What is an Object?

Principles of OO Programming.

Divide and Conquer

Breaking down a large complex problem into smaller, more manageable pieces.

Encapsulation

Each object knows and contains the data and methods needed to perform its own task.

Interface

Clearly and explicitly defines how an object interacts with other objects (public).

Information Hiding

An object keeps its internal details hidden and protected from other objects, and only shares what is needed (private).

Generality

Designing objects so they can be re-used and extended.

Extensibility

Adapting generalized objects to similar, more specialized tasks.

Suggested Review Exercises: #1, 9 (p. 17-18)

 

Chapter 1.

What is the difference between an application and an applet, in Java?

 

Some Java program components:

 

An example of a simple Java application - note the comments, the class header, and the "main" method. Also, note the right and left brackets which enclose program blocks.

Java applets are more complicated to write than applications. This is because they are intended to run within a Web browser, and make use of a Graphical User Interface (GUI). The following example of an applet must import 2 Java class libraries, java.awt and java.applet. This shows Java's ability to frequently re-use existing program modules, and thus to take advantage of previously developed and tested programs.

 

How do I develop a Java application or applet?

There are 3 steps: editing, compiling, and executing.

Editing a Java Program

Compiling a Java Program

Running (Executing) a Java Application

 

Running (Executing) a Java Applet

 

Designing Good Programs

Exercise: make a copy of p. 29 in your text, and use it as a reference every time you sit down to develop a new program.

The Software Development Process

To Specify the Problem, ask yourself (and answer) these 3 questions:

To Decompose the Problem

To Design, ask and answer these questions for each object:

Example: Design Specification for the Rectangle class

 

More Design: Data, Methods, and Algorithms

Method Design

Coding into Java: Always Use Stepwise Refinement

Exercise: Take the Stepwise Refinement Viewlet Tutorial.

Testing, Debugging, and Revising

 

Writing Readable Programs

Good Programming Style

 

Simple non-graphical Input and Output in Java

Example in HelloWorld (see above):

System.out.println("Hello World!");

Also see example on p. 40, OldMacDonald.java class.

Qualified Names.

The dot notation tells the Java compiler where to find the "referent" (the leftmost item in the name). The qualifiers may refer to packages, libraries, classes, etc. depending upon the context in which they are used.

System.out.println() refers to the Java System class library, the out object, and the println() method.

 

Suggested Exercises for Chapter 1: All self-study exercises, tutorial viewlets, practice quizzes from the text Web site.