Customer Reviews


25 Reviews
5 star:
 (16)
4 star:
 (4)
3 star:
 (4)
2 star:
 (1)
1 star:    (0)
 
 
 
 
 
Average Customer Review
Share your thoughts with other customers
Create your own review
 
 
Only search this product's reviews

The most helpful favorable review
The most helpful critical review


16 of 16 people found the following review helpful:
5.0 out of 5 stars Excellent explanation of Java generics and its usage
The intent of Generics is make your Java code type-safer. While Java is a strongly typed language, it lacks type-safety when it comes to using collections. Generics were added to the Java programming language in 2004 as part of J2SE 5.0. Unlike C++ templates, generic Java code generates only one compiled version of a generic class. Generic Java classes can only use object...
Published on December 3, 2006 by calvinnme

versus
9 of 10 people found the following review helpful:
3.0 out of 5 stars Average, Nothing Exciting... not much more than its online alternative...
It's a decent reference and a great read to go over generics and the collections framework. But don't get me wrong, it's nothing you can't get from just reading the Sun-provided API documentation or tutorials covering the topics.

It's comprehensive, sure... but the examples lean to near overkill on each topic in some areas. In other areas, there just isn't...
Published on March 11, 2008 by J. Brutto


‹ Previous | 1 2 3 | Next ›
Most Helpful First | Newest First

16 of 16 people found the following review helpful:
5.0 out of 5 stars Excellent explanation of Java generics and its usage, December 3, 2006
This review is from: Java Generics and Collections (Paperback)
The intent of Generics is make your Java code type-safer. While Java is a strongly typed language, it lacks type-safety when it comes to using collections. Generics were added to the Java programming language in 2004 as part of J2SE 5.0. Unlike C++ templates, generic Java code generates only one compiled version of a generic class. Generic Java classes can only use object types as type parameters -- primitive types are not allowed. Thus a List of type Integer, which uses a primitive wrapper class is legal, while a List of type int is not legal.

Part I of this book provides a thorough introduction to generics. Generics are a powerful, and sometimes controversial, new feature of the Java programming language. This part of the book describes generics, using the Collections Framework as a source of examples.

The first five chapters focus on the fundamentals of generics. Chapter 1 gives an overview of generics and other new features in Java 5, including boxing, foreach loops, and functions with a variable number of arguments. Chapter 2 reviews how subtyping works and explains how wildcards let you use subtyping in connection with generics. Chapter 3 describes how generics work with the Comparable interface, which requires a notion of bounds on type variables. Chapter 4 looks at how generics work with various declarations, including constructors, static members, and nested classes. Chapter 5 explains how to evolve legacy code to exploit generics, and how ease of evolution is a key advantage of the design of generics in Java. Once you have these five chapters under your belt, you will be able to use generics effectively in most basic situations.

The next four chapters treat advanced topics. Chapter 6 explains how the same design that leads to ease of evolution also necessarily leads to a few rough edges in the treatment of casts, exceptions, and arrays. The fit between generics and arrays is the worst rough corner of the language, so two principles are formulated to help work around the problems. Chapter 7 explains new features that relate generics and reflection, including the newly generified type "Class T" and additions to the Java library that support reflection of generic types. Chapter 8 contains advice on how to use generics effectively in practical coding. Checked collections, security issues, specialized classes, and binary compatibility are all considered. Chapter 9 presents five extended examples, looking at how generics affect five well-known design patterns: Visitor, Interpreter, Function, Strategy, and Subject-Observer. The following is a list of chapters in part one:

Chapter 1. Introduction
Chapter 2. Subtyping and Wildcards
Chapter 3. Comparison and Bounds
Chapter 4. Declarations
Chapter 5. Evolution, Not Revolution
Chapter 6. Reification
Chapter 7. Reflection
Chapter 8. Effective Generics
Chapter 9. Design Patterns

Part II is about the Java Collections Framework, which is a set of interfaces and classes in the packages java.util and java.util.concurrent. They provide client programs with various models of how to organize their objects, and various implementations of each model. These models are sometimes called abstract data types, and they are needed because different programs need different ways of organizing their objects. In one situation, you might want to organize your program's objects in a sequential list because their ordering is important and there are duplicates. In another, a set might be the right data type because now ordering is unimportant and you want to discard the duplicates. These two data types and others are represented by different interfaces in the Collections Framework, and there are examples of their use in chapter 10. However, none of these data types has a single "best" implementation--that is, one implementation that is better than all the others for all the operations. For example, a linked list may be better than an array implementation of lists for inserting and removing elements from the middle, but much worse for random access. So choosing the right implementation for a program involves knowing how it will be used as well as what is available.

This part of the book starts with an overview of the Framework and then looks in detail at each of the main interfaces and the standard implementations of them. Finally the book examines the special-purpose implementation and generic algorithms provided in the Collections class. The following is a list of chapters in part two:

Chapter 10. The Main Interfaces of the Java Collections Framework
Chapter 11. Preliminaries
Chapter 12. The Collection Interface
Chapter 13. Sets
Chapter 14. Queues
Chapter 15. Lists
Chapter 16. Maps
Chapter 17. The Collections Class

Overall, this is a very good book on the subject of Java generics, and I highly recommend it.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


21 of 23 people found the following review helpful:
4.0 out of 5 stars Good, but could be better, February 6, 2007
By 
Gregory Guthrie "guthrie" (Fairfield, IA United States) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
This review is from: Java Generics and Collections (Paperback)
Java generics are a welcome and important addition to the Java language, but because of their Erasure based implementation, they are somewhat limited and confusing to use.

This book is good in that it does cover many of the issues, and some interesting applications, but is I think limited in both explanations, and examples. Their section on Generics and Design patterns is a welcome one, but very short, and not very long on rationale or depth on other applications. If the examples they show is the only impact of generics on design patterns, something is wrong!

The standard Generics tutorials by Bracha and Langer, and the IBM DeveloperWorks series by Allen are more complete, and more descriptive, and free! I found the lumping of collections together with Generics ok, but a bit indicative that they ran out of real generics material. They are also IMHO a bit defensive on the long contested Erasure approach, but do explain their viewpoint well. They fault the C# and C++ approaches too quickly, noting the problems but not the corresponding solutions provided. Hopefully next versions of Java will (soon) provide reified versions of generics, it looks like it is in process now.

I did think it a worthwhile read, but not as much as expected.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 8 people found the following review helpful:
5.0 out of 5 stars Everything you ever wanted to know about collections and generics..., December 16, 2006
This review is from: Java Generics and Collections (Paperback)
This is one of the most in-depth books on the Java topics of generics and collections... Java Generics and Collections, by Maurice Naftalin and Philip Wadler. It covers the gamut from the basics to advanced...

Contents:
Part 1 - Generics: Introduction; Subtyping and Wildcards; Comparison and Bounds; Declarations; Evolution, Not Revolution; Reification; Reflection; Effective Generics; Design Patterns
Part 2 - Collections: The Main Interfaces of the Java Collections Framework; Preliminaries; The Collection Interface; Sets; Queues; Lists; Maps; The Collections Class; Index

There have been quite a few books out that deal with the new Java 5.0 features, of which generics and collections are the featured items. But few go past the basics and common usage. Naftalin and Wadler devote this entire book to just those new features, which means they can spend a lot more time diving into the guts of how they work. There are nice "before generics" and "after generics" comparisons in the one section, so you can see how current coding styles can be enhanced and modified. I also liked how some basic design patterns were used to show how generics can be incorporated into standard designs. The collections material is just as helpful. Each type of collection is covered in detail, both for the reference on how it's coded as well as diagrams to show the architecture of that type of list. Again, when you get done with the section, there shouldn't be too many questions and issues surrounding collections that you can't answer or at least figure out.

Solid material, and definitely a title you'll want to have around when you start playing around with generics and collections...
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


9 of 10 people found the following review helpful:
3.0 out of 5 stars Average, Nothing Exciting... not much more than its online alternative..., March 11, 2008
This review is from: Java Generics and Collections (Paperback)
It's a decent reference and a great read to go over generics and the collections framework. But don't get me wrong, it's nothing you can't get from just reading the Sun-provided API documentation or tutorials covering the topics.

It's comprehensive, sure... but the examples lean to near overkill on each topic in some areas. In other areas, there just isn't enough information or example code to really drive home the ideas.

It's average and worth the read. Not worth keeping around, though. It's one of those "read-once-then-give-it-to-a-friend" books. Like I said, though: you should definitely read this book if you're looking for more information on these topics. You'll just find yourself hitting resources online for more information in areas you are particularly interested in (concurrency w/ collections, for example).
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


5 of 5 people found the following review helpful:
4.0 out of 5 stars Ready to Learn Generics and Collections?, February 1, 2007
This review is from: Java Generics and Collections (Paperback)
The Java Generics book provides an in-depth analysis of the new Generics and Collections APIs in Java 5 and 6. The book provides a level of detail on this new technology that can not be found elsewhere. This book is generally not for a novice programmer due to the level of architectural details and theory. It provides a seasoned programmer with a comprehensive examination of why and how the Generics and Collections APIs were modified, as well as, the design decisions and impact. The book provides the programmer with the information they need to make informed decisions on which type of Collection to use, and the associated pitfalls based on design decisions.

The only issue I found with the book was that it did not provide enough concrete examples. The code was provided generally in code snippets which do not provide enough detail.

The book is a definite choice for the advanced Java programmer and architect. If you are serious about learning these new technologies: this is the book to get.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 2 people found the following review helpful:
5.0 out of 5 stars Wonderful Book on Generics and Collections With Java Focus, August 17, 2007
By 
This review is from: Java Generics and Collections (Paperback)
'Java Generics and Collections' by Maurice Naftalin in a fantastic book focussed on this interesting topic of generics and collections with Java as the main language to explore these programming concepts. At nearly 300 pages in length, this book has plenty of meat and content within. I love the new font look in this O'Reilly book and was impressed all throughout while perusing this book. 15 chapters of content are seen when you pull back the cover and start reading. This book 'could' be for the most novice of programmers but it's better suited towards a more experienced programmer that is looking to expand their knowledge and become a BETTER developer.

If you want to learn about generics and collections for Java or any language, this is a great reference to learn and expand your development skillset with best practices in mind.

**** HIGHLY RECOMMENDED
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 2 people found the following review helpful:
5.0 out of 5 stars Finally, A Book Devoted To Generics And Collections, August 12, 2007
By 
Dave Walz-Burkett (Albuquerque, NM United States) - See all my reviews
This review is from: Java Generics and Collections (Paperback)
Ever since the release of Java 5, I've been keeping my eyes open for a book that describes what I believe to be the most powerful new feature of Java - generics. The new book published by O'Reilly, Java Generics and Collections covers the topic in spades. As a bonus, the second half of this book examines the Java Collections Framework. Since the Collections Framework was rewritten to incorporate the use of generics, it makes perfect sense for the authors to spend a reasonable amount of time describing the new interfaces.

A brief introduction highlights the use of generics, autoboxing, foreach loops, generic methods and varargs. The examples are written using the Collections Framework. Subtyping and the use of wildcards follow the introduction and begin to show the real power of generics.

Getting past the basics, a chapter devoted to the Comparable and Comparator interfaces describes some very useful concepts, such as how to use the Comparable interface to find the minimum or maximum element in a collection. The use of enumerated types is briefly covered here, as well as the concepts of multiple bounds, bridges and covariant overriding.

A chapter describing how to declare a generic class helps you build your own classes. Following that is a useful chapter that describes how the design of generics is evolutionary, not revolutionary. It details how generics in Java 5 allow you to gradually migrate your legacy code, rather than replace it all at once.

If you use generic types in casts, instance testing, exceptions or arrays, a chapter on reification warns you of rough edges and limitations you may find and describes some workarounds. How generics changes reflection is also covered.

The last two chapters of the first half of the book describe how to use generics effectively in your code and provide samples of how implementations of select design patterns can take advantage of generics.

The second half of the book, which dives into the Collections Framework, starts with a quick chapter called 'Preliminaries' that spends time discussing underlying concepts, such as the Iterable interface. Thread safety issues are covered in this chapter as well. Thread-safe concurrent collections were introduced in Java 5 and their use, as compared with synchronized collections is also discussed.

The Collection interface is given its own chapter, which is important considering that it defines functionality common to any type of collection other than maps. Following are chapters describing sets, queues and lists. The Map interface also warrants its own chapter, in which the available methods and the various map implementations are discussed. The comparative performance of different set, queue, list and map implementations is shown in tables at the end of each chapter.

Following the Collection and Map interface chapters is the final chapter which describes the Collections class in detail. The Collections class contains static methods that operate on collections or return them.

I found the code and diagrams in this book very easy to understand and a great resource when trying to decide which collection or map implementation to use for a specific problem.

Once you learn how to take advantage of generics, you'll begin to write more useful, reusable code. This book now occupies a space on my shelf next to my Algorithms and Data Structures books.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


2 of 2 people found the following review helpful:
5.0 out of 5 stars A 'must' for any working Java programmer., December 11, 2006
This review is from: Java Generics and Collections (Paperback)
Java's had many changes since its initial release and programmers would find it easy to fall behind on all these new collection libraries, so Java Generics and Collections is an essential tool for any programmer working in Java lready, who would keep up with the design and nature of generics. From parameter basics and new features to using wildcards, generic libraries and understanding performance implications of their different options, Java Generics and Collections is a 'must' for any working Java programmer.

Diane C. Donovan
California Bookwatch
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


4 of 5 people found the following review helpful:
3.0 out of 5 stars Oddly dull for an interesting topic; not Wadler's best, August 8, 2007
By 
Eric Kaun (Pittsburgh, PA United States) - See all my reviews
(REAL NAME)   
This review is from: Java Generics and Collections (Paperback)
I've read many of Wadler's whitepapers (usually on Haskell), and have always found him interesting. That's why this book was a bit of a surprise; parts of it were very hard to get through. Some of the examples (mostly the relentless focus on the Collections framework) were, frankly, dull. Much of the writing was repetitive. And many times the authors referred to another complex or difficult concept by section number, rather than briefly summarizing the issue. Apparently they were trying to be concise, but they succeeded in being cryptic.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


1 of 1 people found the following review helpful:
5.0 out of 5 stars Explains the inexplicable, October 16, 2008
By 
Frank Kieviet (Southern California) - See all my reviews
(REAL NAME)   
This review is from: Java Generics and Collections (Paperback)
There are some difficult issues with Java Generics. This book does an excellent job explaining them. It also provides a good guide when to use generics, its limitations, and the new limitations that it introduces for arrays.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


‹ Previous | 1 2 3 | Next ›
Most Helpful First | Newest First

This product

Java Generics and Collections
Java Generics and Collections by Philip Wadler (Paperback - October 24, 2006)
$34.99 $29.94
In Stock
Add to cart Add to wishlist