Object Oriented Computing

Dilvan de Abreu Moreira

March 1998


Table of Contents

1. Object Oriented Programming
1. Semantic Gap
2. Objects
3. Classes and Instances
4. Inheritance
5. Polymorphism
2. The Java Software
1. Introduction
2. Java Interpreter
3. Differences from C++
4. Objects in Java
3. The Java Language
1. Variables and Data Types
2. Operators
3. Expressions and Control Flow Statements
4. Arrays
4. OOP in Java
1. Objects
2. Classes
3. Subclasses and Inheritance
4. Interfaces
5. Packages
5. Essencial Classes
1. String Class
2. System Class
3. Input/Output Streams
6. Exceptions
1. What are exceptions?
2. Throwing exceptions
3. Catch or specify requirement
4. Catching and handling exceptions
7. Threads
1. What is a Thread?
2. Thread Attributes
3. Thread Group
4. Synchronizing Threads
8. UML
1. UML - Unified Modeling Language
2. UML Diagrams
3. Main Diagrams
4. Uses Cases Diagrams
5. Class Diagrams
6. Sequence and Activity Diagrams
7. Summary
9. Associatons and Collections
1. Overview
2. Association
3. Composition
4. Aggregation
5. Core Collection Interfaces
6. Collection Interface
7. Set Interface
8. List Interface
9. Object Ordering - Comparable Interface
10. Graphic User Interface
1. Overview
2. Swing Containers
3. Swing Components
4. Swing Menus
5. Handling Events
6. Layout Managers
7. AWT Graphics
8. Images
11. Distributed Programming
1. The Client/Server Model
2. URLs
3. Sockets and Streams
4. Datagrams
12. Applets
1. Overview
2. Creating an Interface
3. Communication with Other Programs
4. Capabilities and Restrictions
13. Case Study: JUnit
1. Overview
2. The Example Problem
3. Making a Test Suite
4. Running the tests
5. Adding New Code
6. Testing Practice
7. Lecture Notes
14. Decoupling
1. Why Decompose
2. Dependence Relationships
3. Dependences & Specifications
4. Techniques for Decoupling
5. Coupling Due to Shared Constraints
6. Lecture Notes
15. Decoupling in Java
1. Java Name Space
2. Access Control
3. Safe Languages
4. Interfaces
5. Lecture Notes
16. Object Contract
1. Equality Properties
2. Hashing
3. Clone
4. Lecture Notes
17. Specification
1. Introduction
2. Behavioral Equivalence
3. Specification Structure
4. Declarative Specification
5. Exceptions and Preconditions
6. Shorthands
7. Judging Specifications
8. Lecture Notes
18. Dynamic Analysis
1. Defensive Programming
2. Testing
3. Criteria
4. Subdomains
5. Subdomain Criteria
6. Feasibility
7. Lecture Notes
19. UDF
1. Unit Development Folder
2. Unit Development Folder Guide
20. Exercises
1. Basic Exercises 1
2. Basic Exercises 2
3. Basic Exercises 3
4. Getting Started with Java
5. Java Exercises
6. Design an Abstract Data Type
21. Individual Assignments - Laboratory
1. The Eclipse Platform
2. Derive a Class for Complex Numbers
3. Using UML inside Eclipse
4. Interval Class
5. Using the Visual Editor
6. Pocket Calculator
7. Using JUnit with Eclipse
22. Group Assignments
1. Text Editor
2. Video Tape Store
3. Course Applet
4. Chat
5. File Manager
6. PacMan
7. Foliotracker
23. Extra: Graphic User Interface - AWT
1. Overview
2. AWT 1.1 Components
3. AWT 1.1 Menus
4. AWT 1.1 Containers
5. AWT Peers
24. Extra: Distributed Applications
1. Applications
2. SQL Databases
3. TP Monitors

List of Figures

1.1. Semantic Gap
1.2. The outside world view of an object
1.3. Instances of class Man
1.4. Classes inheritance
1.5. Polymorphism
3.1. Pointers in Java
3.2. Memory Structure: 2 pointers
3.3. Memory Structure: Same pointer
4.1. Subclass
4.2. Inheritance
4.3. Graphic Classes
5.1. charAt() Method
5.2. Inside the StringBuffer
5.3. System Class
5.4. Runtime Object
5.5. A stream of data entering a program.
5.6. A stream of data leaving a program.
5.7. InputStream Class
5.8. OutputStream Class
6.1. Call Stack
6.2. Catching an Exception
6.3. Advantage 3
6.4. Throwable and its Subclasses
6.5. General Handler
7.1. Thread States
7.2. ThreadGroup Class
9.1. Car as a collection of parts
9.2. Association between Seminar and Course
9.3. Composition: Building X Room
9.4. Aggregation X Composition
9.5. Kinds of Collections
10.1. AWT Peers
10.2. AWT similar components
10.3. New components
10.4. Converter of distances between US and metric.
10.5. Classes in the Example Program
10.6. JPanel subclass.
10.7. Dialog
10.8. A JOptionPane input dialog
10.9. Buttons
10.10. Labels
10.11. Checkbox
10.12. Radiobutton
10.13. Combo box
10.14. List
10.15. ScrollPane
10.16. JTextComponent hierarchy
10.17. JTextField and JTextArea components
10.18. Menu
10.19. Menu-related classes hierarchy
10.20. BorderLayout
10.21. BorderLayout Expanded
10.22. CardLayout: Buttons
10.23. CardLayout: TextField
10.24. FlowLayout
10.25. FlowLayout: Expanded
10.26. GridLayout
10.27. GridLayout: Expanded
10.28. GridBagLayout
10.29. GridBagLayout: Expanded
10.30. Custom Layout
10.31. Custom Layout: Expanded
10.32. No Layout Manager
10.33. No Layout Manager: Expanded
10.34. Coordinate System
10.35. Shape Sampler
10.36. Drawing Text
10.37. Image Filters
10.38. setPixels() Method
11.1. Heterogeneous network
11.2. Network Stack
11.3. Ports
11.4. Port Numbers
11.5. Listening and Communicating
11.6. Threads in Servers
12.1. Graphic Classes
12.2. Quote Applet
12.3. Window Applet
12.4. Applet Viewer Security Restrictions
12.5. Applet Viewers Window
12.6. Applet Look
13.1. Running a Test Suite
14.1. Uses Diagram of a Web browser.
14.2. Layered diagram for the Protocol module.
14.3. Display showing a cycle relationship with Main.
14.4. Specifications S and T.
14.5. Callback by a Listener Class.
15.1. Package Dependence Diagram.
21.1. Pocket Calculator Window
22.1. Foliotracker Window
23.1. The AWT
23.2. Converter of distances between US and metric.
23.3. Classes in the Example Program
23.4. AWT Hierarchy
23.5. AWT MenuComponent Hierarchy
23.6. Buttons
23.7. Labels
23.8. Canvas
23.9. Checkbox
23.10. Choice
23.11. List
23.12. ScrollPane
23.13. TextComponent
23.14. Menu
23.15. MenuComponent
23.16. Panel Subclass
23.17. Dialog
23.18. AWT Peers
24.1. Middleware View
24.2. Nested Transactions
24.3. Request Through ORB
24.4. ORB Interfaces
24.5. Interoperation With Other Systems

List of Tables

1.1. Invoice Object
3.1. Primitive Data Types
3.2. Arithmetic Operators
3.3. Relational Operators
3.4. Conditional Operators
3.5. Bitwise Operators
3.6. Short Cut for the Assignment Operator
3.7. Control Flow Statements
4.1. Access to Members of a Class
5.1. System Properties
6.1. Advantage 1
6.2. Advantage 2
10.1. AWT Events
12.1. Available System Properties
12.2. Forbidden System Properties
19.1. UDF Cover Page