1 Java Workshop Detailed Course Description Center for Electronic Governance United Nations University International Institute for Software Technology www.egov.iist.unu.edu 1. Overview Java is an Object-Oriented programming language designed and developed by Sun Microsystems. It is a modern language that has become the language of the choice for many programmers, particularly for writing programs that have to run on a variety of different computer systems. The language was designed from the outset to be simple, robust, secure, and machine-independent. Java has matured immensely in recent years, particularly with the introduction of Java 2. The range of functions provided by the core Application Programming Interfaces (APIs) has grown substantially. For instance, there are APIs to support the development of applications that rely on a Graphical User Interface (GUI), extensive image processing and programmable graphics. Java APIs exist to access relational databases and to communicate with remote computers over a network. Java can also be used to write applets - programs that are embedded inside Internet web pages to provide interactivity. Java also supports the development of multithreaded and distributed applications. This document presents a refresher course on Java Technology. The main part of the course is the introduction to the language, first the procedural and then the object-oriented part. A number of selected APIs are introduced next - those that are used across the language and those that are designed to perform specific functions. The duration of the course is 40 hours and the target audience is software practitioners with some basic programming experience. The rest of this document explains the objectives, prerequisites and methodology for teaching the course in Sections 2, 3 and 4 respectively. The content of the course is introduced in Section 5, followed by assessment and organization in Sections 6 and 7 respectively. Following references, Appendix A includes the complete set of slides and Appendix B contains two sets of assessment questions with answers. 2. Objectives The course has five main objectives: 1) To refresh and reinforce the knowledge of Java Technology. 2) To review selected Java APIs (libraries). 3) To learn best practices in developing Java applications. 4) To provide solid foundation for learning J2EE Technology. 5) To explain why Java is adequate for implementing government services. 2 3. Prerequisites The course assumes that: 1) The students have some knowledge of Object-Oriented Analysis and Design. 2) The students have the ability to develop desktop applications using any Object-Oriented or Object-Based programming language. 4. Methodology The course has been designed relying on some general didactic principles: 1) Concepts are first defined and illustrated with some concrete examples, before they are used or applied in any context. 2) Visual illustrations are used as much as possible. 3) Assessment is carried out at the end of every section. 4) Most exercises require hands-on participation. 5) The overall assessment is administered at the end of the course to test the general understanding of the material presented. Generally, an instructor is expected to administer the course in a tutorial style. 5. Content The course is divided into five sections: Introduction, Language, Object-Orientation, Horizontal Libraries and Vertical Libraries. They are described as follows. 5.1. Introduction This section, comprising the slides 14 through 54 provides an overview of Java. It starts by presenting the origin and history of Java then explains the components of the Java platform - a Virtual Machine, a set of Application Programming Interfaces and the language itself. The highlights, features and goals of the language are explained as well, showing how to set up the runtime environment and how to use Java documentation. The section concludes by demonstrating how to write, compile and run a simple Java application. 5.2. Language This section, comprising the slides 55 to 204 introduces the procedural part of the Java language. It explains the different syntactic elements, data types, arrays and operators - assignment, relational, logical and bitwise and others. A number of procedural control structures to express sequencing, selection and iteration are presented as well. 5.3. Object Orientation This section, covered by the slides 205 through 4, presents the object-oriented aspects of the language. It elaborates on how to encapsulate data and behavior within classes, how to build hierarchies of classes with inheritance, how to determine the behavior of objects at run-time, how to group classes into packages and how to introduce abstraction through interfaces. The section concludes by introducing exception handling and multithreading. 3 5.4. Horizontal Libraries This section consists of the slides 5 to 783. It presents three major horizontal APIs provided by Java: String-Handling, Event-Handling and Object Collections. The String Handling section explains how Java manipulates strings. The Event Handling section explains how programs can handle events. The Object Collection section explains how to group objects and how such groups can be manipulated. 5.5. Vertical Libraries This section, comprising the slides 784 to 907 presents a number of APIs that are designed to perform specific functions. Specifically, it introduces the Swing APIs for building Graphical User Interfaces and applets. An applet allows a Java application to be executed within a web browser, as part of viewing a web page. 6. Assessment Assessment questions are provided at the end of the course to test the student's understanding of the various topics taught. The assessment is more like a quiz which tests the general understanding of the course. The assessment does not replace the exercises provided across the various sections, nor the tasks students are asked to perform. The tasks, in particular, are more rigorous and aim to test the depth of the understanding in specific areas. The assessment consists of multiple choice questions. 7. Organization The course is designed to be taught during 42 hours and over a period of seven days. 8. References 1. Java 2 The Complete Reference, Herbert Schildt, Osborne, 5th edition, 2002. 2. The Java Tutorial, Sun Microsystems, http://java.sun.com/docs/books/tutorial/, 2004. 3. Bruce Ecker, Thinking in Java, 3rd edition, Prentice Hall, 2002. 4. Sun Microsystems, Inc, Java™ Look and Feel Design Guidelines: Advanced Topics, Addison Wesley, December 27, 2001. 5. Robert Simmons Jr, Hardcore Java, O'Reilly, March 2004. 6. Ian F. Darwin, Java Cookbook, 2nd Edition, O'Reilly, June 2004. 7. Scott Oaks, Henry Wong, Java Threads, Third Edition, O'Reilly, September 2004. 8. Ivor Horton, Beginning Java 2, SDK 1.4 Edition, Wrox Press, 2003.