REVIEW - Principles of Object-Oriented Programming in Java 1.1 - The Practical Guide to Effective, Efficient Program Design


Principles of Object-Oriented Programming in Java 1.1

The Practical Guide to Effective, Efficient Program Design


James W. Cooper



Ventana (1999)




Jason Hulance


February 1999



This book is one of the few in the category of teaching OOP using Java, which made it a candidate for the course text of an OOP course I was helping to give for the local University. In 1996 (when we last gave this OOP course) there were very few Java books on the shelves, and not even the great Core Java had faultless example Java code. Two years on, we hoped the situation might have changed. There are certainly a plethora of Java books out there now, but still not very many good ones.

So what of Cooper's book? Well, it seems to start off on the right lines, with an overview of what OOP means, then some simple Java syntax, then more details of OOP in Java, and so on. But from the beginning you get the feeling that it's a rushed job or (like many others) not actually a Java book, more a simple conversion from a book on some other language. In particular, the OO examples Cooper chooses are far from illustrative or natural; they make you wonder why he chose them rather than think about the point he's trying to make.

One thing that clearly comes across from the book is that Cooper fought hard with the compiler to get it to accept his programs. The text is littered with advice in the style of error message circumvention, rather than using features effectively and promoting a good coding style. As seasoned programmers know, it's best to try to find the correct shaped pin rather than bang the wrong one in with a hammer...

Common, basic Java errors are evident, too. Cooper obviously does not understand the difference between the "==" operator and the "equals" method, so it is not surprising that his examples only work with the accidental co- operation of Java's string management. You get a strong feeling that Cooper's background of Visual Basic is showing through...

Inconsistency is another flaw common in this kind of book. At one point Cooper tells you that using "switch" (or in his case, lots of "if"s) over different types is wrong and that using inheritance (i.e., pure polymorphism) is the correct approach. Then about 40 pages later his major example doeseverything the wrong way. He also falls foul of that popular inconsistency: screenshots that clearly weren't generated from the presented code.

But probably the biggest thing that upset me about this book is the quite awful chapter on exceptions. Cooper's battles with the compiler are most manifest here, probably because the point of exceptions seems entirely lost on him. In his first complete example he

stops the compiler producing an error by initialising an object to "null", and thereby misses the fact that his program might later dereference it! When the code for the next example can fail to perform its cleanup properly, it becomes clear that Cooper finds Java's exceptions to be a real hindrance. So much so, that he then constructs a wrapper class that smothers all exceptions and provides a "checkErr" method instead. Oh dear, oh dear.

All in all, this book is probably not much worse than many others out there. Its Java is quite poor and although its coverage of OOP is verging on adequate, it is far too brief. In the end, we chose Budd's Understanding Object-Oriented Programming with Java for our course text; it's a greatly superior book in OO terms, although its Java is still imperfect.

Book cover image courtesy of Open Library.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.