售价: ¥362.00 + 免配送费
前翻 后翻
正在播放... 已暂停   您正在聆听的 Audible 音频版本的样品。
查看全部 2 张图片

Java Generics and Collections (英语) 平装 – 2006年11月3日

平均4.3 星
5 星
4 星
3 星
2 星
1 星
平均4.3 星 30条美国亚马逊评论 us-flag |
| 天天低价·正品质优

显示所有 2 格式和版本 隐藏其他格式和版本
全新品最低价 非全新品最低价
平装, 2006年11月3日

click to open popover


  • iPhone/iPad/Mac
  • Android手机或平板电脑



  • 出版社: O'Reilly Media, Inc, USA (2006年11月3日)
  • 平装: 294页
  • 语种: 英语
  • ISBN: 0596527756
  • 条形码: 9780596527754, 0636920527756
  • 商品尺寸: 17.8 x 1.8 x 23.3 cm
  • 商品重量: 481 g
  • ASIN: 0596527756
  • 用户评分: 分享我的评价
  • 亚马逊热销商品排名: 图书商品里排第1,420,743名 (查看图书商品销售排行榜)
  •  您想告诉我们您发现了更低的价格?



"This is a very good book on two fairly focused topics - generics and collections. If you plan to make best use of either or both, buy a copy." - Ian Elliot, VSJ, April 2007


Maurice Naftalin is Director of Software Development at Morningside Light Ltd., a software consultancy in the United Kingdom. Maurice consults mainly in object-oriented technologies and teaches Java classes part-time at Learning Tree. He has three decades' experience as a programmer, team leader, and commercial trainer. Philip Wadler is a professor of theoretical computer science at the University of Edinburgh, Scotland, where his research focuses on functional and logic programming. He co-authored the Generic Java standard that became the basis for generics in Sun's Java 5.0 and also contributed to the XQuery language standard base. Professor Wadler received his Ph.D., in computer science from Carnegie-Mellon University and co-wrote "Introduction to Functional Programming" (Prentice-Hall).



5 星
4 星
3 星
2 星
1 星

此商品在美国亚马逊上最有用的商品评论 (beta)

美国亚马逊: 平均4.3 星 30 条评论
25/25 人认为此评论有用
平均5.0 星 Excellent explanation of Java generics and its usage 2006年12月3日
评论者 calvinnme - 已在美国亚马逊上发表
版本: 平装
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.
29/32 人认为此评论有用
平均4.0 星 Good, but could be better 2007年2月6日
评论者 gGuthrie - 已在美国亚马逊上发表
版本: 平装 已确认购买
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.
16/17 人认为此评论有用
平均3.0 星 Average, Nothing Exciting... not much more than its online alternative... 2008年3月12日
评论者 J. Brutto - 已在美国亚马逊上发表
版本: 平装 已确认购买
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).
10/10 人认为此评论有用
平均5.0 星 Everything you ever wanted to know about collections and generics... 2006年12月17日
评论者 Thomas Duff - 已在美国亚马逊上发表
版本: 平装
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...


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...
6/6 人认为此评论有用
平均4.0 星 Ready to Learn Generics and Collections? 2007年2月1日
评论者 John Yeary - 已在美国亚马逊上发表
版本: 平装
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.