Object-Oriented Design with Java

Jon Pearce
Mathematics and Computer Science Department
San Jose State University
(408) 924-5065
pearce@mathcs.sjsu.edu


Contents

1. Object-Oriented Design
2. Architectural Design
3. Event Notification
4. Frameworks, Toolkits, and Polymorphism
5. Reflection and Persistence
6. Delegation
7. Presentation and Control
8. Remote and Active Objects
9. Extreme Programming
Appendix 1: Introductory Programming in Java
 


Preface
 
 

Java was developed by Sun Microsystems. Sun hosts a gigantic web site devoted to Java products and news. The home page of this web site is located at:

http://java.sun.com/

Downloading the SDK

Java takes the concept of freeware to a new level. Programmers can freely download the Java software development kit (SDK) at:

http://java.sun.com/j2se/

The software development kit consists of a compiler, virtual machine, applet viewer, and a few other useful tools. The SDK also consists of a large library of useful, predefined classes. There are several versions of the SDK. In these notes we are using version 1.3 of the standard edition. (Note, after version 1.1, Sun seems to have changed the name of the platform to Java 2.)

Downloading the IDE

Next, programmers will probably want an integrated development environment (IDE). There are many commercial products available, but one of the best (i.e., least worst) is Sun's Forte. The community edition can be freely downloaded at:

http://www.sun.com/forte/ffj/ce/

We will use this IDE for debugging, but for other development activities we will use the tools in the SDK plus a simple text editor. A good text editor can streamline the development process. We recommend TextPad, a shareware editor available at:

http://www.textpad.com

Shareware means if you like it, then you should buy it. Currently, the cost of TextPad is about $40.

Downloading the Documentation

The home page for all Java 1.3 SDK documentation is located at:

http://java.sun.com/j2se/1.3/docs/

Each class provided by the SDK has its own web page that explains what the class is for and what services the class provides. We can download these pages or we can view them on the web at:

http://java.sun.com/j2se/1.3/docs/api/index.html

Downloading Books

There are many books about Java, but beginners can start by freely downloading the book The Java Tutorial located at:

http://java.sun.com/docs/books/tutorial/index.html

Sun also prescribes a set of style conventions for Java programs. Although not mandatory, following a standard style convention will make your programs look more professional. They will also make your programs easier to read. The Sun style conventions are specified in the book Code Conventions for the Java Programming Language, which can be downloaded or read at:

http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

More advanced programmers may need to consult The Java Language Specification for detailed information on how Java works. This can be downloaded or read at:

http://java.sun.com/docs/books/jls/html/index.html

A good, comprehensive guide to Java is the latest edition of Core Java, Volume 1, by Horstmann and Cornell. Unfortunately, readers will have to actually pay for this book.

Downloading Programs

Programmers may wish to skip the programming phase altogether. Several sites contain free programs that can be downloaded. These sites also have answers to frequently asked questions (FAQs), discussion groups, gurus, and other useful features. One example is the Gamelan site located at:

http://gamelan.earthweb.com/

IBM is one of the biggest promoters of Java. Their site, Java Technology Zone, is located at:

http://www.ibm.com/developer/java/



 

References

Books and Papers

[ALX]   Christopher Alexander. The Timeless Way of Building. Oxford University Press. New York, NY. 1979.

[AND]   John R. Anderson. Cognitive Psychology and It's Implications, ed. 3. W. H. Freeman and Co. New York, NY. 1990.

[ANTI]   Brown, Malveau, McCormick, Mowbray. AntiPatterns. Wiley. New York, NY. 1998.

[ATK]   M.P. Atkinson, P.J. Bailey, K.J. Chisolm, W.P. Cockshott, and R. Morrison. "An Approach to Persistent Programming". Computer Journal, 26(4), 360 – 365. 1983.

[BOO]   Grady Booch. Object Oriented Analysis and Design with Applications. Benjamin/Cummings, Redwood City. 1994.

[COAD]   Peter Coad. ???

[CON]   Thomas Connolly and Carolyn Begg. Database Systems: A Practical Approach to Design, Implementation, and Management, ed. 2. Addison-Wesley, Reading, MA. 1998.

[COOP]   Doug Cooper. Oh My! Modula-2! An Introduction to Programming. W. W. Norton & Co., New York and London. 1990.

[COPE]   James O. Coplien. Advanced C++: Programming Styles and Idioms. Addison-Wesley, Reading, MA. 1992.

[FIRE]   Morris Firebaugh. Artificial Intelligence, A Knowledge-Based Approach. Boyd & Fraser Publishing Company. Boston, MA. 1988.

[FOW-1]   Martin Fowler with Kendall Scott. UML Distilled: Applying the Standard Object Modeling Language. Addison-Wesley, Reading, MA. 1997.

[FOW-2]   Martin Fowler. Analysis Patterns: Reusable Object Models. Addison-Wesley, Reading, MA. 1997.

[GAB]   Richard P. Gabriel. Patterns of Software: Tales from the Software Community. Oxford Press, New York, NY. 1996.

[Go4]   Erich Gamma, Richard helm, Ralph Johnson, and John Vlissides. Design Patterns, Elements of Reusable Object-Oriented Software. Addison Wesley, Reading, MA. 1995.

[HORST-1]   Cay S. Horstmann. Mastering Object-Oriented Design in C++. Wiley & Sons, New York, NY. 1995.

[HORST-2]   Cay S. Horstmann. Mastering C++: An Introduction to C++ and Object-Oriented Programming for C and Pascal Programmers, 2 ed. Wiley & Sons, New York, NY. 1996.

[JAC-1]   Ivar Jacobson, Magnus Christerson, Patrik Jonsson, and Gunnar Övergaard. Object-Oriented Software Engineering: A Use Case Driven Approach. Addison-Wesley, Reading, MA. 1992.

[JAC-2]   Ivar Jacobson, Grady Booch, and James Rumbaugh. The Unified Software Development Process. Addison-Wesley, Reading, MA. 1998.

[KUN]   James Kunstler. Home from Nowhere. Simon and Schuster, New York, NY. 1996.

[LAN]   Thomas K. Landauer. The Trouble with Computers: Usefulness, Usability, and Productivity. MIT Press, Cambridge, MA. 1995.

[LAR]   Craig Larman. Applying UML and Patterns. Prentice Hall, Upper Saddle River, NJ. 1998.

[LEE]   Richard C. Lee and William M. Tepfenhart. UML and C++: A Practical Guide to Object-Oriented Development. Prentice Hall, Upper Saddle River, NJ. 1997.

[LTZ]   B.P. Lientz and E.B. Swanson. Software Maintenance Management. Addison-Wesley, Reading, MA. 1980.

[MKE]   J.R. McKee. "Maintenance as a Function of Design". Proc. AFIPS National Computer Conf. Las Vegas, 187-93. 1984.

[OMG]   A Discussion of the Object Management Architecture. The Object Management Group, Inc. 1997.

[POSA]   Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal. Pattern Oriented Software Architecture: A System of Patterns. Wiley. New York, NY. 1998.

[PEA]   Pearce. Programming and Meta Programming in Scheme. Springer. New York, NY. 1998.

[PFL]    Shari Lawrence Pfleeger. Software Engineering Theory and Practice. Prentice Hall, Upper Saddle River, NJ. 1998.

[POPE]   Alan Pope. The CORBA Reference Guide: Understanding the Common Object Request Broker Architecture. Addison-Wesley, Reading, MA. 1997.

[ROG]   Gregory F. Rogers. Framework-Based Software Development in C++. Prentice Hall, Upper Saddle River, NJ. 1997.

[ROY]   W.W. Royce. "Managing the Development of Large Software Systems: Concepts and Techniques". Proc. IEEE WESTCON, Los Angeles. 1970.

[RUM]   James Rumbaugh, Michael Blaha, William Premerlani, Frederick Eddy, and William Lorensen. Object-Oriented Modeling and Design. Prentice Hall, Upper Saddle River, NJ. 1991.

[SCH]   Stephen R. Schach. Classical and Object-Oriented Software Engineering, ed. 4. WCB McGraw-Hill, Boston. 1999.

[SHEP]   George Shepherd and Scot Wingo. MFC Internals: Inside the Microsoft Foundation Class Architecture. Addison-Wesley, Reading, MA. 1996.

[SHN]   Ben Shneiderman. Designing the User Interface, Strategies for Effective Human-Computer Interaction , ed. 3. Addison-Wesley, Reading, MA. 1998.

[SOM]   Ian Sommerville. Software Engineering, ed. 5. Addison-Wesley, Reading, MA. 1996.

[STR]   Bjarne Stroutrup. The C++ Programming Language, ed. 3. Addison-Wesley, Reading, MA. 1997.

[WIN]   Terry Winograd and Fernando Flores. Understanding Computers and Cognition: A New Foundation for Design. Ablex Publishing Corporation. Norwood, NJ. 1986.

Web Sites

Warning: web sites are more fleeting than books and papers, and of course they aren't subject to the same reviews, but some are important and unique sources of information.

[WWW-1]   www.mathcs.sjsu.edu/faculty/pearce

[WWW-2]   www.parc.xerox.com/spl/projects/oi/

[WWW-3]   www.parc.xerox.com/spl/projects/mops/

[WWW-4]   www.parc.xerox.com/spl/projects/aop/

[WWW-5]   www.ibm.com/Java/Sanfrancisco/concepts/concepts.html

[WWW-6]   www.rational.com

[WWW-7]   www.javasoft.com

[WWW-8]   hillside.net/patterns/patterns.html

[WWW-9]   www.c2.com/ppr/index.html

[WWW-10]   www.ibm.com/Java/Sanfrancisco

[WWW-11]   www.parc.xerox.com/spl/projects/oi-at-parc/

[WWW-12]    www.odmg.org

[WWW-13]   www.mathcs.sjsu.edu/pearce/mfc

[WWW-14]   www.omg.org

[WWW-15]   www.rational.com/uml/resources