Outline of Class 12: Javadoc and Java Wrapup
Held: Friday, February 6, 1998
- I will not be returning
assignment one or
assignment two. Why not? Because these assignments were to get
you started with Java and to get you thinking about particular concerns.
- Today we'll spend most of the day on lab
5.
- Randy Smith of Torrent Systems, Inc., a "Parallel Software
Infrastructure Company", will give a talk entitled The Programming
They Don't Teach You In College on Monday, February 9, as part of
the noon brown-bag lunch series.
- Read Bailey, Chapter 3, for Monday's class.
- Java provides a simple program,
javadoc, that can
build HTML documentation from your Java code, especially if you
follow a particular commenting style.
- Some online documentation for javadoc can be found at
- You should include javadoc comments for your objects and methods.
- The basic form of a javadoc comment is
/**
* Here's the comment
*
* @author Your name
* @version 1.0
* ...
*/
- The comments can include HTML tags.
- The lines preceded by at-signs are special tags.
- Special tags include
-
@author
-
@version
-
@see
-
@version
-
@param
-
@return
-
@exception
- The HTML files that are generated load images from the subdirectory
images. While I can't find the piece of the
javadoc documentation the specifies where to find those images,
I've placed them in ~rebelsky/pub/javadoc.images,
and you can create a symbolic link to that directory.
What have we learned up to this point about object-oriented programming,
Java, and other issues?
What have we learned about object-oriented (OOP) programming?
- Programs consist of collections of objects and
classes which can
be dynamically created or added (and deleted, but that's somewhat
less important).
- The objects communicate with each other by calling methods of other
objects. One might also say that objects can send messages
to each other.
- These methods compute and act, sometimes returning values.
- Classes are used to specify general characteristics of objects:
the attributes they have (but not the value of those
attributes) and the methods they provide (and how they work,
which often depends on the values of these attributes).
- Classes can provide constructors which are used to
build new objects within the class.
- By using inheritance, it is possible to refine a class
without redefining the many of the core methods or attributes
of the class.
- Members of the subclass (refined class) can be used wherever
members of the superclass can be used.
- It is important to separate what an object does (its methods)
from how the object does what it does (the implementation of
its methods).
- It is possible to specify only the "what" part using interfaces
which act somewhat like superclasses.
What have we learned about Java?
- Java is an object-oriented programming language.
- In Java, one class has a designated
main routine which
starts (and governs) the interaction between classes.
- In Java, methods are defined somewhat imperatively, using
assignments, loops, conditionals, and function calls.
- Java is polymorphic in that it is possible to have multiple
functions with the same name that behave differently based on the
types of arguments with which they are called.
- Most methods have an implicit "this" argument.
- Java uses exceptions to handle error checking.
- Java provides a variety of commenting styles to support the variety
of types of comments you might write.
- Every class in Java is a descendent of
Object and should
provide a variety of functions corresponding to that class.
What else have we learned in our "introduction to Java" portion of the
course?
- OOP program design has both similarities and differences from
functional design.
- The separation of interface from implementation can be good, but
it requires us to carefully consider the design of the interface.
- Error checking is important and should be included early in the
design cycle and not late in the design cycle.
- There are a variety of types of comments one might use in developing
a program. Some are for the user of a class, some for the modifier
of that class, and some for the user of a program.
- As our programs get larger, we need to consider not just the
individual functions, but the relationships between those functions.
- ...
Most of today's class will be lab 5.