Java Generics and Collections | 
enlarge | Authors: Maurice Naftalin, Philip Wadler Publisher: O'Reilly Media, Inc. Category: Book
List Price: $34.99 Buy New: $19.59 You Save: $15.40 (44%)
New (33) Used (8) from $18.09
Rating: 21 reviews Sales Rank: 34758
Format: Illustrated Media: Paperback Pages: 294 Number Of Items: 1 Shipping Weight (lbs): 1.1 Dimensions (in): 9.1 x 7 x 0.9
ISBN: 0596527756 Dewey Decimal Number: 005 EAN: 9780596527754
Publication Date: October 17, 2006 Availability: Usually ships in 1-2 business days Shipping: International shipping available Condition: Brand new item. Over 4 million customers served. Order now. Selling online since 1995. Few left in stock - order soon. Code: I20081201033114S
| |
| Similar Items:
|
| Editorial Reviews:
Product Description This comprehensive guide shows you how to master the most important changes to Java since it was first released. Generics and the greatly expanded collection libraries have tremendously increased the power of Java 5 and Java 6. But they have also confused many developers who haven't known how to take advantage of these new features. "Java Generics and Collections" covers everything from the most basic uses of generics to the strangest corner cases. It teaches you everything you need to know about the collections libraries, so you'll always know which collection is appropriate for any given task, and how to use it. Topics covered include: Fundamentals of generics: type parameters and generic methods Other new features: boxing and unboxing, foreach loops, varargs Subtyping and wildcards Evolution not revolution: generic libraries with legacy clients and generic clients with legacy libraries Generics and reflection Design patterns for generics Sets, Queues, Lists, Maps, and their implementations Concurrent programming and thread safety with collections Performance implications of different collections Generics and the new collection libraries they inspired take Java to a new level. If you want to take your software development practice to a new level, this book is essential reading. Philip Wadler is Professor of Theoretical Computer Science at the University of Edinburgh, where his research focuses on the design of programming languages. He is a co-designer of GJ, work that became the basis for generics in Sun's Java 5.0. Maurice Naftalin is Technical Director at Morningside Light Ltd., a software consultancy in the United Kingdom. He has most recently served as anarchitect and mentor at NSB Retail Systems plc, and as the leader of the client development team of a major UK government social service system. ""A brilliant exposition of generics. By far the best book on the topic, it provides a crystal clear tutorial that starts with the basics and ends leaving the reader with a deep understanding of both the use and design of generics."" Gilad Bracha, Java Generics Lead, Sun Microsystems
|
| Customer Reviews: Read 16 more reviews...
Much-needed impressive coverage of these two topics November 4, 2006 Rich Rosen 20 out of 20 found this review helpful
I've been looking for a long time for a good book covering in-depth the subject of collections since Sun introduced the Java Collections API. There were high-priced generalized books about algorithms in general, and data structures textbooks that seemed to get lukewarm receptions. I've used Collections a lot and over time with repeated usage I learned the mechanics and when to use which type of Collection, but especially with the advent of Java Generics (which intertwines heavily with any sophisticated usage of Collections in Java 5), I wanted something with more extensive coverage. This book really fits the bill. Its explanations of the semantics and functionality of the different Collections classes are simple but never pedantic. It would be useful for both experienced developers and newbies. - If you're neck deep in Java 5 development and using Generics in your own code, this will fill in a lot of the gaps, showing how you can write your own classes that make use of Generics (including usage of "super" and "extends notations for defined types), and explaining the error messages you may see involving "erasure" when attempting to instantiate variables that are defined with generics. - If you're a long time Java developer who's still using Hashtables, Vectors and Enumerations for everything, this book covers the whys and hows of switching to the Collections interfaces and implementations, advocating "evolution not revolution"--e.g., don't rewrite all your underlying code just to replace all Hashtables with HashMaps, or even to replace raw Collections with generics-savvy ones, but write new code to be agnostic about whether legacy implementations or generic-savvy implementations are used. - If you're more a newbie to all this, the book covers data structures, algorithms, and O-notation--not at textbook or classroom level, but enough to explain the concepts. The book also covers not only how one MIGHT write the provided implementations of Collections interfaces but how they were written by Sun (and how they weren't written, too). The factory methods in the Collections utility class for unmodifiable, synchronized and checked Collections are also covered. It might have been helpful to include more sophisticated examples of custom generics-savvy classes (e.g., how to write your own generic factory class) but all in all this book was very impressive. It would be useful for experienced Java 5 developers, experienced pre-Java-5 Java developers, experienced legacy (pre-Collections-API) Java developers, and junior Java developers taking the leap into Generics and Collections.
Excellent explanation of Java generics and its usage December 3, 2006 calvinnme (Fredericksburg, Va) 8 out of 8 found this review helpful
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.
Everything you ever wanted to know about collections and generics... December 17, 2006 Thomas Duff (Portland, OR United States) 5 out of 5 found this review helpful
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...
A 'must' for any working Java programmer. December 11, 2006 Midwest Book Review (Oregon, WI USA) 2 out of 2 found this review helpful
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
Wonderful Book on Generics and Collections With Java Focus August 17, 2007 Daniel McKinnon (Tewksbury, MA USA) 2 out of 2 found this review helpful
'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
|
|
|