Online Sample Chapter
Introduction to Objects, UML, and Java
Downloadable Sample Chapter
Click below for Sample Chapter related to this title:
Table of Contents
(NOTE: Most chapters conclude with a Summary.)
1. Objects, UML, and Java.
Object-Oriented Design and the UML.
The Payoff of Objects. 2. The Essence of Objects.
What Is an Object-Oriented System?
Fundamental Properties of an Object-Oriented System.
Abstraction with Objects.
Communication via Messages.
An Example—Putting it All Together.
Other OO Concepts.
Visibility of Methods.
Class versus Instance.
A Low-Level View of Objects.
Resources. 3. Objects in Java.
Defining Classes in Java.
Association, Aggregation, and Composition.
Object Lifetime in Java.
Class versus Instance Methods and Attributes.
Copies of Objects.
Resources. 4. Object-Oriented Analysis and Design.
The Elements of a Software Project 84
The Essence of Object-Oriented Analysis.
Evaluate Candidate Objects.
Determine Object Hierarchies.
Discover Object Attributes.
Discover Object Operations.
The Essence of Object-Oriented Design.
Some Design Guidelines.
Get the Big Picture.
The Build and Release Phases.
Building the Software.
Releasing the Software.
More on the UML.
Resources. 5. Object-Oriented Graphical User Interfaces with Swing.
Graphical User Interfaces.
A Typical Application.
A Brief Introduction to Swing.
MVC: Model, View, Controller.
MVC with Java.
A Small Swing MVC GUI Framework.
A Simple Application Based on Wmvc.
UML Sequence Diagram for Thermometer.
Resources. 6. A Case Study in Java.
Analysis of MovieCat.
MovieModel Class. View Classes.
Putting It All Together.
Implementation of MovieCat.
Design of MovieCat.
Movie Helper Classes.
Review. 7. Design Patterns.
What are Design Patterns?
using Design Patterns.
Designing Pattern Description Templates.
The Gang of Four Patterns.
Example Design Patterns Used by Wmvc and MovieCat.
Observer Pattern in Wmvc.
Command Pattern in Wmvc.
Other Patterns Used in Wmvc and MovieCat.
Resources. 8. Refactoring.
What Is Refactoring?
The Basic Refactoring Process.
When do You Refactor?
When Not to Refactor.
Some Specific Refactorings.
Resources. 9. Software Development Methodologies.
Methodologies for Large Scale Projects.
Overview of the Unified Process
Agile Methodologies for Small Projects.
Crystal/Adaptive Software Development.
Open Source Development.
Open Source Is Distributed Development
Resources. 10. Software Tools for Object-Oriented Development.
GUIs versus Consoles.
Characteristics of a Good Editor.
Three Types of Editors.
Integrated Development Environments.
CASE, Modeling, and UML Tools.
Other UML Tools. 11. Programming—A Personal Perspective.
Your Code Never Dies.
Programming with Style.
Know What You are Doing.
Write Practice Programs.
Practical Incremental Programming.
The Tools Matter.
Objects Rally Help.
Don't Reinvent the Wheel.
Sometimes It Is Better to Do It Yourself.
You Can Get Ideas Any Time.
Get a Life.
A Plan Matters.
Your Editor Really Matters.
Know About the Time-Tested Tools.
Know About the Latest Tools.
Tools Go Away.
The Work Environment.
A Happy Programmer Is a Productive Programmer.
Share the Struggle.
Let Programmers Help Make Policy.
Let Your Boss Know What You Need.
The Reference Software Story.
Use the Web.
Watch Out for the Web.
Use Open Source if You Can.
Web Sites. 12. What Next?
More Terms You Need to Know.
Distributed Computing Terms.
Java-Related Terms from Sun.
Other Terms. Glossary. Index. 0201734109T12052001
Why This Book?
The goal of this book is to cover what you need to know to develop object-oriented (OO) software using Java and the Unified Modeling Language (UML). When you are through with this book, you should understand object-oriented software development well enough to answer the following questions.
- What is object orientation?
- What is the UML?
- What is object-oriented analysis and design (OOAD)?
- How do you do OOAD?
- What are object-oriented development methodologies?
- How do you use Java to write truly object-oriented programs?
- What is Swing, and how can you use it to write object-oriented graphical user interfaces?
- What are design patterns?
- What is refactoring?
- What tools do you use to write object-oriented programs?
- What are some guidelines for writing good code?
- What do you need to read next to learn even more about object orientation?
Who Is This Book For?
This book is intended for programmers who know the basics of programming with Java and now want to understand the fundamentals of object-oriented software development. If you're fairly new to programming and have had a class or two in Java, you're probably starting to feel comfortable with Java. Now you're ready to reap the benefits of true object-oriented programming in Java, and this book will help you.
If you're an experienced programmer who wants to move from using an old-style procedural programming language to developing object-oriented systems in Java, this book is also for you. This book will take you well down the path to real object-oriented software development. If you have a Java manual available for quick reference, you will likely be able to learn the most important aspects of Java from the examples included in this book.
However, this book should not be the last one you read on object orientation, the UML, or Java. Instead, it should give you an essential understanding of objects so that you can read additional advanced and detailed books on the topic with greater purpose.
Overview of Chapters
Chapter 1 is a brief introduction to objects and the benefits of object-oriented software development.
Chapter 2 covers the fundamental concepts of object orientation. Object orientation has many important concepts, and of course, its own vocabulary. It is important for you to understand the main concepts and to be familiar with the specialized vocabulary. Even if you are familiar with some object-oriented concepts, you should review them in this chapter. Basic UML is also introduced.
Chapter 3 covers how to use Java to write object-oriented programs. It is not really a Java tutorial, but rather concentrates on using Java to implement object-oriented concepts. The first part of the chapter covers basic Java concepts. The later parts of the chapter cover more-advanced topics, such as object lifetime, copies of objects, and other concepts that are crucial when working with classes and objects.
Chapter 4 covers object-oriented analysis and design (OOAD). Rather than focus on any specific OOAD methodology, this chapter covers basics that are important for any methodology.
The first four chapters cover the essence of object orientation. Chapter 5 takes a look at graphical user interfaces (GUIs) and the Java Swing library, using the object-oriented perspective developed in the previous chapters. This object-oriented introduction to Swing is a somewhat different approach than is typically found in Swing tutorials.
Chapter 6 ties everything together with a case study of a small Java application. The fundamental OOAD concepts covered in Chapter 4 are used to design the application, and the Java and Swing concepts covered in Chapters 3 and 5 are used for the implementation.
The goal of the remainder of the book is to give you a good overview of the practical aspects of object-oriented programming. Chapter 7 introduces design patterns, a recent development that uses previously developed software design patterns to make designing new software easier. Chapter 8 covers refactoring, which is a disciplined object-oriented approach to revising and enhancing existing software. Chapter 9 gives brief overviews of some of the current software development methodologies for large- and small-scale object-oriented software projects. Chapter 10 covers some of the current software tools available for developing object-oriented software. Finally, Chapter 11 gives some of my personal guidelines for developing better software.
About the Author
I wrote my first program more than 30 years ago, and I have been developing software ever since. Most of that software has been for the PC marketplace, which means that my code has had to do a useful job, do it with as few bugs as possible, and be passed on to others for continued development. It has meant that I've had to be efficient and practical. For a long time, I've wanted to share my practical experience with other programmers.
So, what is all this experience I've had? Right after I finished my PhD in computer science at the University of Utah, in 1979, I worked on security software at the Sandia National Laboratory. However, I found the emerging personal computer world much more exciting. I left Sandia Labs, started a small software company, and wrote one of the first spelling checkers that ran on a PC. My next step was to write the first PC-based grammar and writing style checker.
I sold my company and began teaching computer science at the University of New Mexico, a relationship that lasted, at least on a part-time basis, until 1997. But I just couldn't stay out of the PC business. I continued my work on grammar checking, and in 1985 started a new PC software company with some partners in San Francisco. That company, Reference Software International, developed and marketed the Grammatik grammar checker. I was chief scientist there, and built a fairly large software development group to improve Grammatik and build other reference software products. WordPerfect bought Reference Software in 1992, and I went back to teaching at the University of New Mexico. It was there that I first thought of writing a book about object-oriented programming.
In the mean time, I designed and wrote an open source C++ GUI framework, called V. It is an easy-to-use framework for building simple GUI applications on Windows and X, and is in widespread use today. I also wrote the VIDE freeware editor and integrated development environment, which is also widely used.
Of all the advancements in software development I've witnessed over the years, object-oriented programming in Java and C++ has seemed the most significant in terms of how much easier it makes the programming task. While object orientation doesn't solve all the problems of software development, it makes development and long-term maintenance much easier. The result is a real gain in programming productivity. So it is well worth the effort to learn object-oriented software development.
The goal of this book is to introduce you to the essence of object orientation without overwhelming you with all the details of a specific object-oriented development methodology or every nuance of a programming language. After years of teaching programming and software engineering, I've found that learning to use Java or any other object-oriented programming language comes more easily if you first get a good understanding of objects and of designing systems using objects.
I have found that just because programmers are using an object-oriented programming language doesn't mean they are writing good object-oriented programs. Without a good understanding of object orientation, it is impossible to realize its full benefits, including the most important--software that is easier to write and maintain.
First, I must thank my family for putting up with me for the past year while I've been holed up in my office working on this book. I know they would have liked to have me around more, but writing this book has been something I've needed to do for many years. And special thanks to my son, Van, who created the great Kokopelli programmer drawing for the cover.
I also must thank Ross Venables, the editor at Addison-Wesley who discovered an early version of this book on my Web site and encouraged me to turn it into a complete book. And I want to thank Paul Becker, who took on this project and saw it to completion.
I want to thank all the other people who helped make this book better, from the reviewers and editors at Addison-Wesley to all those who sent me suggestions and feedback on the early drafts posted on my Web site.
Bruce E. Wampler
Glenwood Springs, Colorado
Aabstract classesdefined, 267overview of, 29-30Abstract Windowing Toolkit (AWT), 109, 110abstractiondefined, 11, 267with objects, 13, 29accessor, 267. See also getteraction events, Swing, 112activity diagrams, UML, 102actors, defined, 267Ada, 3Adaptive Software Development, 227agents, defined, 267aggregationdefined, 21, 267in Java, 54-57in OO relationships, 27-29in UML, 18Agile Alliancemethodologies, small projects, 217-219software development manifesto, 218-219Web site resources, 217-219anonymous listener, Swing, 118application servers, 268ArgoUMLsoftware tools, 241-242Web site resources, 242associationdefined, 19, 268in Java, 54-57in OO relationships, 27-29in UML, 17attributesclass, 33defined, 268encapsulated classes, 14instances, 33of objects, 8AWT (Abstract Windowing Toolkit), 109
Bbase classes, defined, 268Beck, Kent, 104, 219behaviorsdefault, 23defined, 14, 268expressed by methods, 16black box, 2Booch, Grady, 104, 214borrowing association, 19build and release phase, 98-100
CC++compared with Java, 61-62, 271debugging, 250explicit description of objects in, 16friend specifier, 32inheritance in, 24, 48as object oriented language, 1, 3-4, 9, 13, 245support for, 236, 242, 243call listeners, Javaanonymous, 118defined, 273inner class, 120single class, 34callback, defined, 34, 268candidate objects, 84-87change events, Swing, 112classversus instance, 32-33versus methods and attributes, 62-63class attributesdefined, 268methods and, 30-32class hierarchies, as principles, 29class method, defined, 269class notation, UML, 17-18class-responsibility-collaborator (CRC) cards, 85-87classesabstract, 29-30concrete, 30defined, 8, 268defining in Java, 40-44designing in OOAD, 95-96encapsulated, 11-14hierarchies, 12, 18naming conventions for, 45simple view, in UML,, 18view, in MovieCat, 155-158code listings. See program listingscode review, and ownership, 99cohesion, defined, 269COM, defined, 269command design, 200command events, Swing, 112-121command patterns, Java, 199-201communication, via messages, 14-15compositiondefined, 21, 269in Java, 54-57in OO relationships, 27-29concrete class, 269constants, 46constructorsdefined, 16, 269in Java, 60-61containers, 33, 269copies, of objects, 63-70core class, 269COS naming, 269coupling, defined, 269CRC (class-responsibility-collaborator cards), 85-87Crystal/Adaptive Software Development, 223Crystal, Web site resources, 227Cunningham, Ward, 104, 219customers, defined, 78, 269CVS, 241Cygwin, 231
DDAP (directory access protocol), 270DCE (distributed computing environment), 270DCOM (distributed component object model), 270debugging, 250deep copy, defined, 64, 270default behaviors, defined, 270deployment diagrams, in UML, 103derived subclasses, 23, 270description templates, in design patterns, 190-191design patternscommand pattern in Wmvc framework, 199-201description templates, 190-191Gang of Four, behavioral, 193-195Gang of Four, creational, 192Gang of Four, observer, 195-199Gang of Four, structural, 192-193overview of, 189-190resources, 201summary, 201used by Wmvc and MovieCat, 195-198, 201using, 190destructors, defined, 270developer organizations, defined, 78, 270diagrams, class, 18dialog boxes, in GUIs, 108directory access protocol (DAP), 270distributed component object model (DCOM), 270distributed computing, defined, 270distributed computing environment (DCE), 270DSDM (Dynamic Systems Development Method), 222-223dynamic bindingdefined, 270in polymorphism, 27Dynamic Systems Development Method (DSDM), 222-223
Eeditorsdesirable characteristics of, 231-232Emacs, 233-234GUI, 29, 233modeless, 232types of, 232-233vi, 234-235VIM, 235Eiffel, 3EJB (Enterprise JavaBeans), 270Emacs, 233-234encapsulated classes, 29encapsulationof classes, 13-14defined, 11, 270Enterprise JavaBeans (EJB), 270eventscommand , in Swing, 112-121defined, 270Extreme Programming (XP)overview of, 219-220practices of, 220-221rising interest in, 221-222values of, 219-220Web site resources, 227
Ffeasibility, risk assessment, 78, 270finalizer methods, Java, 271Forte, 239-240Fowler, Martin, 37frameworks, of classes, 106, 271friend class, 271friend specifier, C++, 32function. See method
GGang of Fourbehavioral patterns, 193-195creational patterns, 192pattern templates, 191patterns, using, 191-195structural patterns, 192-193garbage collectiondefined, 17, 271in Java, 60-61generalization/specializationin animals, 22defined, 21, 271generic/parameterized classes, defined, 271getter methodsdefined, 271visibility and, 32GNU projectin open source development, 224Web site resources, 227, 234graphical user interfaces (GUI)dialog boxes, 107-108events in, 108-109overview of, 106-108Swing as, 109-112typical application, 106-107vs. consoles, 230
Hhas-a, whole/part relationships, 20, 271hierarchiesclass, 12, 18defined, 19, 271generalization/specialization in animals and, 22whole/part relationships, 20Hypertext Transfer Protocol (HTTP), 271
IIBM Visual Age for Java. See Visual Age for JavaIDE. See integrated development environment (IDE)identity, of objects, 17, 271IDL (interface description language), 271IIOP (Internet Inter-ORB Protocol), 272implements, specification, 24, 272inheritancein C++, 24, 48defined, 23, 272designing, OOAD, 96-97in Java, 24, 48-54multiple, 24in OO relationships, 27-29polymorphism and, 24single, 24in UML, 18, 22initial specification, software, 78, 272instance attributes, 33, 62-63, 272instance methods, 33, 62-63, 272instances, 16, 272instantiation, of objects, 16, 272integrated development environment (IDE)software tools, 231, 235-236VIDE, free IDE, 236-237interaction, via messages, 11interface description language (IDL), 272interfacesdefined, 273Java, 57-60Internet Inter-ORB Protocol (IIOP), 272is-a, inheritance relationships, 21, 272is-a tests, 25, 272iterator method(s), 34, 273
JJ2EE (Java 2 Enterprise Edition), 273Jacobson, Ivar, 214Java. See also Java, support for object orientationclasses, 40-44compared with C++, 61-62, 271constructors, 60-61creating new objects in, 35garbage collection in, 16, 60-61IDEs, Forte, 239-240IDEs, JBuilder, 237-239IDEs, Visual Age, 240implements, defined, 24inheritance, 24, 48-54interfaces, 57-60memory leaks in, 61-62memory use in, 35naming conventions, 45-46object lifetime, 60as object-oriented language, 3-4references for tracking objects, 16temporary storage, 35visibility, 44-47Java 2 Enterprise Edition (J2EE), 273Java case study (MovieCat)analysis of, objects, attributes and operation discovery, 148-151analysis of, situation evaluation, 151analysis of, use cases, 146-148design of, Movie class, 152-153design of, MovieModel class, 153-155design of, view classes, 155-158implementation of, MainView class, 168-172implementation of, Movie class, 160-163implementation of, Movie helper classes, 183-185implementation of, MovieCat class, 159-160implementation of, MovieEditor class, 179-183implementation of, MovieItemView class, 175-179implementation of, MovieListView class, 173-175implementation of, MovieModel class, 163-168other aspects, 262overview of, 145-146review and summary, 185-187Java database connectivity technology (JDBC), 273Java naming and directory interface (JNDI), 273Java native interface (JNI), 273Java, support for object orientation, 39-72. See also Javaassociation, aggregation and composition, 54-57class vs. instance methods and attributes, 62-63copies of objects, 63-70defining classes, 40-44inheritance, 48-54interfaces, 57-60messages, 70-71object lifetime, 60-62resources, 71summary, 71visibility, 44-47Java Swing Library. See SwingJava transaction API (JTA), 273Java transaction service (JTS), 273Java virtual machine (JVM), 273JavaServer pages (JSP), 273JBuilderas Java IDE, 237-239screen layout, 237Web site resources, 238JDBC (Java database connectivity technology), 273JFrame, practical structure of, 111Jikessoftware tools, 244Web site resources, 244JNDI (Java naming and directory interface), 273JNI (Java native interface), 273JSP (JavaServer pages), 273JTA (Java transaction API), 273JTS (Java transaction service), 273JUnit, 244JVM (Java virtual machine), 273
Llarge-scale projects, 214-215links, to classes, 34, 273Lisp, 3listeners. See call listeners, Javalistings, code. See program listingslistings, program. See program listingslow-level view, of objects, 34-36
MMagicDrawsoftware tools, 242Web site resources, 242MainView class, in Java case study, 168-172member, defined, 273memory, Javaleaks, 61-62use, 35message-oriented middleware (MOM), 274messagescommunication via, 14-15interaction via, 11overview of, 70-71methodologies, software, 76-77methodsclass, 33constructor, 16defined, 14, 274instance, 33naming conventions for, 45middleware, defined, 274mix-in class/interface, 34, 274Model/View/Controller (MVC)diagram of, 122with Java, 123-125overview of, 122-123sample application, MainView.java, 140-141sample application, TemperatureView.java, 141-142sample application, Thermometer app, 137-139sample application, ThermometerModel.java, 139-140UML sequence diagram for Thermometer, 142-143Wmvc framework, controller subclasses, 133-136Wmvc framework, WmvcApp class, 125-129Wmvc framework, WmvcController class, 131-132Wmvc framework, WmvcExecutor class, 136-137Wmvc framework, WmvcModel class, 130Wmvc framework, WmvcView class, 130-131modifier, of objects, 274modules, program, 274MOM (message-oriented middleware), 274Movie classesin Java case study, 154planning, 152-153using, 160-163Movie helper classes, 155, 183-185MovieCat application. See Java case study (MovieCat)MovieEditor class, 179-183MovieItemView class, 175-179MovieListView class, 173-175MovieModel, 153-155, 156, 163-168multiple inheritancedefined, 272of subclasses, 24multiplicity attribute, 19, 274mUMLsoftware tools, 243Web site resources, 243MVC. See Model/View/Controller (MVC)
Nnameschoosing names, 88-89COS naming standards, 269Java conventions, 45-46Netscape C language API (NSAPI), 274nouns, in Java case study, 148-150NSAPI (Netscape C language API), 275
OObject Data Management Group (ODMG), 275object database management system (ODMS), 275Object Management Group (OMG), 4-5, 275object orientation, 7-37. See also Java, support for object orientationclass defined, 8concepts, abstract classes, 29-30concepts, accessing objects, 33-34concepts, class vs. inheritance, 32-33concepts, low-level view, 34-36concepts, visibility of methods, 30-32defined, 10, 275example, 27-29fundamental properties, 10-18fundamental properties, abstraction with objects, 10, 13fundamental properties, class hierarchies, 12, 18-25fundamental properties, communication via messages, 11, 14-15fundamental properties, encapsulated classes, 11, 13-14fundamental properties, object lifetime, 12, 15-18fundamental properties, polymorphism, 12-13, 25-27object defined, 7object-oriented systems, 9-10resources, 37summary, 36value of, 5object-oriented-analysis and design (OOAD)build and release phase, building the software, 98-100build and release phase, releasing the software, 100-101design guidelines, class design, 95-96design guidelines, encapsulation, 95design guidelines, general guidelines, 97-98design guidelines, getting the big picture, 94-95design guidelines, inheritance, 96-97determining object hierarchies, 87discovering object attributes, 88-89discovering object operations, 89-91elements of software projects, 77-79essence of object-oriented design, 92-94evaluating candidate objects, 84-85introduction, 2-3object discovery, 82-84resources, 103software methodologies, 76-77summary, 103UML diagrams, 101-103object-oriented database management system (OODBMS), defined, 275object-oriented database (OODB), 275object-oriented-design and UML, 4-5object-oriented graphical interfaces, Swing, 142-144object-oriented languagesC++ as widely used example, 3-4Java as language of choice, 3-4list of, 3overview of, 3-4object-oriented relationships, 27-29object request broker (ORB), 275ObjectDomainsoftware tools, 243Web site resources, 243Objective C, 3Objective Pascal, 3objectsabstraction with, 10, 13accessing, in object-oriented languages, 33-34attributes, 8, 148-151copies of, 63-70defined, 7, 274discovery, in OOAD, 82-84essence of, 36evaluating candidate, 84-87hierarchies, 87identity, 16instances, 16instantiated, 16Java, 35, 71-72lifetime of, 15-18, 29, 60low-level view of, 34-36methods, 14operations, 89-91, 148-151overview of, 7-9state of, 14observer patternsstructure, 197using, 195-198in Wmvc, 198-199, 200ODBC (open database connectivity), 275ODMG (Object Data Management Group), 275ODMS (object database management system), 275OMG (Object Management Group), 4-5, 275OOAD. See object-oriented-analysis and design (OOAD)OODB (object-oriented database), 275OODBMS (object-oriented database management system), 275Open database connectivity (ODBC), 275Open sourcedevelopment, 223-226Web site resources, 227operations, 275. See also methodsORB (object request broker), 275overriding attributes or methods, 23, 275
Ppackage symbol diagrams, UML, 103packages, naming conventions, 45Page-Jones, Meilir, 37part-of, whole/part relationships, 20, 275pattern description templates, Gang of Four, 191patternsbehavioral, 193-195creational, 192observer, 195-198structural, 192-193, 200using, 191-195persistence, of objects, 275POA (portable object adapter), 276polymorphismanimal hierarchy, 26as basic principle of object orientation, 29in class hierarchies, 25-27defined, 25, 276dynamic binding, 27overview of, 12-13portable object adapter (POA), 276private access, classes, 31, 276problem domain, defined, 78, 276problem statement, defined, 276program listingsabstract base class for shapes (Shape.java), 51-52anonymous inner classes for listeners (Simple2.java), 116-118borrowing borrowed implements association (LibraryBook.java), 56-57controller subclass for JButton (WmvcTBButton.java), 135-136controller subclass JCheckBoxMenuItem (WmvcChkMenuItemCt1.java), 134-135controller subclass JMenuItem (WmvcMenuItemCt1.java), 133-134the controller (WmvcController.java), 131-132default package visibility (PackageVisibility.java.Foo.java), 47demonstrates reference, shallow, deep copy (CardHand.java), 65-66to distinguish shallow and deep copy (Card.java), 67the executor (Command pattern) (WmvcExecutor.java), 136extends person, vector borrowing (Reader.java), 57first version of circle (Circle.java), 43-44helper class for evaluation attribute (MovieEvaluation.java), 183-185links to parts (Library.java), 56main view subclass (MainView.java), 140-141MainView for menu and tool bars (MainView.java), 168-172model subclass (ThermometerModel.java), 139-140movie class (Movie.java), 161-163MovieCat main app class (MovieCat.java), 159-160MovieEditor edit a movie (MovieEditor.java), 179-183MovieItemView detail each movie (MovieItemView.java), 175-179MovieListView implements browser (MovieListView.java), 173-175MovieModel class (MovieModel.java), 163-168named inner classes for listeners (Simple2.java), 119-120no links (Page.java), 56point class (Point.java), 41reader reader and LibraryBook (Borrowing.java), 57rectangle derived from Shape (Rectangle.java), 53-54RGB color class (Color.java), 49root class (Person.java), 57to set up JFrame (code excerpt), 110-111single listener (Simple1.java), 114-115thermometer subclass (thermometer.java), 138-139top level base class, Wmvc (WmvcApp.java), 127-129vector page composition links (Book.java), 56view subclass fahrenheit and celsius (TemperatureView.java), 141-142Wmvc model base class (WmvcMode1.java), 130WmvcView base class (WmvcView.java), 130-131programming languages, list of, 3programming resources, 259programming tipscode never dies, 246-247debugging, 250-251do it yourself, 251don't reinvent the wheel, 251getting ideas, 251-252importance of practice, 249importance of style, 247-248incremental approach, 249knowing what you are doing, 248testing, 249-250use of objects, 249-250use of tools, 249-250value of a balanced life, 252value of planning, 252programming toolseditors, 253importance of, 249-250tested and latest, 253-254programming work environment40-hour week, 256communicating with management, 258cooperating with marketing, 256-257flexibility, 255-256keeping up to date, 257physical environment, 255policy making, 257team approach, 256team building at Reference Software, 258protected access, classes, 32, 276public access, classes, 31, 276
RRational Rose, 242-243Rational Unified Process (RUP)basic concepts, 215-217defined, 276large-scale projects, 214-215overview of, 216refactoringcategories of, 208-209defined, 204illustrations of, 209-210overview of, 203-204resources, 211summary of, 205, 211using, 204-205Web site resources, 204when indicated, 206when not indicated, 207reference copy, 64reference, data elements, 17, 276remote method invocation (RMI), 276risk assessment, 78, 271RMI (remote method invocation), 276root classes, 23, 276Rumbaugh, James, 214RUP. See Rational Unified Process (RUP)
SScott, Kendall, 37SCRUM, 227selector, object state, 276service. See methodservlet, Java modules, 277setter method, 32, 277shallow copy, 64single inheritance, 24, 272small-scale projects, 217-219Smalltalk, 3SoftModeler, 243softwarebuilding, 98-100code reviews and ownership, 99project elements, 77-81releasing, 100-101software development methodologiesDSDM, 222-223history of, 213-214large-scale projects, basic concepts, 215-217large-scale projects, overview, 214-215large-scale projects, unified process (RUP), 215open-source development, 223-226resources, 226-227small-scale projects, Agile Alliance, 217-219small-scale projects, extreme programming, 219-222summary, 226software toolsArgoUML, 241-242CASE, 241-243Concurrent Versions System (CVS), 240-241editors, Emacs, 233-234editors, overview, 231-232editors, Vi, 234-235GUIs vs. consoles, 230-231IDEs, Forte, 239-240IDEs, JBuilder,, 237-239IDEs, VIDE, 236-237IDEs, Visual Age, 240Jikes, 244JUnit, 244MagicDraw, 242mUML, 243ObjectDomain, 243overview of, 229Rational Rose, 242-243SoftModeler, 243TogetherSoft, 243specialization/generalization, 21, 22, 271SQL (structured query language), 277SQLJ (structured query language Java), 277statedefined, 14, 277diagrams, in UML, 102expressed by attributes, 16structured query language Java (SQLJ), 277structured query language (SQL), 277subclass, defined, 23, 277superclass, defined, 23, 277Swinganonymous listener, 118AWT and, 110command events, 112-121dialog window, 113inner class listener, 120introduction to, 109-112MVC GUI framework (Wmvc), 125-137options, 121sequence in, 116simple application (Thermometer), 137-142
Ttemporary storage, in Java, 35terminologydistributed computing, 263-264Java-related, 264-265other technical, 265-266this (current object), 34, 277TogetherSoft, 243
UUML. See Unified Modeling Language (UML)Unified Modeling Language (UML)activity diagram, 102aggregation, 18associations, 17class diagrams, 151class notation, 17-18collaboration, 101deployment, 103detail, 22, 92-93diagrams, 80-81, 90-92, 101-103, 127, 142-143, 151functions, 1inheritance, 18MovieCat design and, 158MVC and, 138, 142-143package symbol, 103sequence diagrams, 90-91standard specification of, 4-5state, 101use cases, 80use casesdiagram, 81Java, 146-148UML, 80
Vvariables, naming conventions, 46verbsin Java case study, 150-151in object discovery, 83Vi editor, 234-235VIDE, 236-237viewclass, in MovieCat, 155-158class, in UML, 18VIM editor, 235visibilityclass attributes and methods, 30-32defined, 31, 277friend, 32Java, 44-47private, 31protected, 32public, 31Visual Age for Java, 240
WWeb site resourcesAdaptive Software Development, 227Agile Alliance, 217-219ArgoUML, 242book, this, 229Crystal, 227CVS, 241Cygwin, 231Dynamic Systems Development Method, 222Extreme Programming, 227GNU Emacs, 234GNU project, 227JBuilder, 238Jikes, 244MagicDraw, 242mUML, 243Object Management Group, 4-5ObjectDomain, 243Open source, 227Rational Rose, 242refactoring, 204SCRUM, 227SoftModeler, 243TogetherSoft, 243VIM, 235Visual Age for Java, 240whole/part relationships, 20, 277Wmvccommand patterns, 199-201observer patterns, 198-199
XXMI (XML metadata interchange), 277XML, defined, 277XML metadata interchange (XMI), 277XP. See Extreme Programming (XP)