Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Java 7 New Features Cookbook Paperback – February 23, 2012
|New from||Used from|
The Amazon Book Review
Author interviews, book reviews, editors picks, and more. Read it now
Customers who bought this item also bought
About the Author
Richard M. Reese holds a Ph.D. in Computer Science from Texas A & M University and is currently an Associate Professor in the Department of Engineering and Physics at Tarleton State University in Stephenville, Texas. In addition to his experience in academia, Richard has over 16 years of experience in industry including operating system development at GTE Automatic Electric Labs and at Lockheed Martin in Fort Worth, Texas where he supervised a tool development group and oversaw various research and development projects. Prior to his industrial experience he served four years in the United States Air Force. Richard first worked with EJBs as a consultant/instructor of software languages in private and public classes providing him with a variety of insights into industry applications. He has published numerous papers and has developed courseware for a variety of topics including advanced Java technologies. He has also written the EJB 3.1 Cookbook for Packt Publishing. Jennifer L. Reese holds a B.S. degree from Tarleton State University. She currently works as a software engineer for Local Government Solutions in Waxahachie, Texas, developing software for county government. Prior to graduation, she worked for the Center for Agribusiness Excellence at Tarleton where she used Java in conjunction with GIS software to analyze crop and weather data.
If you buy a new print edition of this book (or purchased one in the past), you can buy the Kindle edition for only $2.99 (Save 88%). Print edition purchase must be sold by Amazon. Learn more.
For thousands of qualifying books, your past, present, and future print-edition purchases now lets you buy the Kindle edition for $2.99 or less. (Textbooks available for $9.99 or less.)
Browse award-winning titles. See more
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
Packt Publishing requested that I review one of their titles about Java 7: Java 7 New Features Cookbook by Richard M. Reese and Jennifer L. Reese, available to buy from Packt's website.
Java 7 New Features Cookbook is an OK, but sometimes inconsistent book. I found parts of it very informative and other parts frustrating, with errors here and there in the example code - overall I'd give it an average score.
The information in the book is very densely packed, but often repetitive and sometimes very slow reading. The information is presented in recipes - how-to examples focusing on a specific Java 7 feature, put together to form a cookbook.
Each recipe is presented in a formulaic way, with information under the sub-headings: 'Getting ready', 'How to do it...', 'How it works...' and 'There's more'. The code examples sufficiently cover the new feature they are trying to demonstrate, and are quite self contained, so you don't need to read the whole chapter to quickly get going with a new Java 7 feature. The 'There's more' sections expand on the basics, fleshing out the examples and include some good tips.
The book covers the full range of Java 7 new features, without going over old ground with respect to previous versions of Java. The book is definitely aimed at developers who are familiar with writing programs in Java 5 and beyond, and not for developers new to Java and OOP. A previous knowledge of Java file I/O, concurrency and a bit of SQL is required to get the most from this book.
This book was difficult to read from cover to cover, and I wouldn't suggest reading it that way. I would recommend consulting its relevant recipes before implementing new code.
A Java 7 JDK installation and an editor are requirements to reproduce the examples in the book. NetBeans 7 is stated as the IDE used to develop the code, but Eclipse or any other IDE or text editor could be used.
A note on the code examples in the book: the immediate thing you notice about the code examples is that they are badly formatted. This coupled with occasional errors in the code and new language syntax, such as try-with-resources, makes for frustrating debugging. The poor code layout is a problem throughout the book and spoilt my enjoyment of it slightly.
Chapter 1 covers new language features from Project Coin. These are small language enhancements designed to make code more readable, more useful and reduce verbosity. The useful new features to take away from this chapter are the new try-with-resources exception handling code, the use of the new AutoClosable interface, catching multiple exception types and using the diamond operator.
This chapter is a good introduction to Java 7 and I think most developers will want to get to grips with all the recipes.
Chapter 2 introduces the new Paths and FileSystem objects, which are used extensively in subsequent chapters. The new classes provide utility methods to simplify the manipulation and comparison of file paths, helping to reducing some of the bespoke code you may have had to write in previous Java versions. The most important feature introduced in this chapter is the managing of symbolic links, but you will need to be running an operating system that supports them.
Chapter 3 deals with file and directory attributes. The first recipe demonstrates a useful new method for determining a files MIME type, something which has required 3rd party libraries in the past. The chapter goes on to give examples of managing file attributes, including support for DOS and POSIX file systems, very useful for managing Linux file permissions, which wasn't directly possible before.
Chapter 4 builds on the previous chapters and uses the new Files object to create, copy, move and delete files and directories with much more control, and much less code than was previously possible. Useful new features presented are temporary file and directory management and creating symbolic and hard links.
Chapter 5 has loads of useful information for interacting with file systems. Recipes include: accessing root file store information, processing directory contents with DirectoryStream, file filtering, globbing patterns, file event monitoring and more! Lastly in this chapter, the ZIP filesystem provider recipe demonstrates how to treat a ZIP or JAR file as though they were file systems.
Java is often criticised for the amount of code needed to perform simple file reading and writing operations. Chapter 6 shows how simple these operations can now be with Java 7, including new APIs for working with buffered I/O. The new SeekableByteChannel class for random access I/O, and the new AsynchronousServerSocketChannel class for building client-server applications are recipes also worth visiting.
Thankfully, after half the book, this is the last chapter that deals with paths, files, files systems, file permissions and file I/O.
Chapter 7 showcases additions to swing which can improve the look of your GUI interfaces. Some of the cool looking new features include window opacity, varying gradient window translucency, and custom window shapes. Less exciting, but definitely useful, border type and print dialog box control recipes are also worth taking a look at in this chapter.
Chapter 9 contains a mix of new features, but has some really useful recipes. Firstly the RowSetFactory example shows how to really reduce the amount of JDBC boiler plate code needed to connect to a SQL database, execute queries and iterate over the returned data.
The next recipe demonstrates further database enhancements for reading database schema and pseudo-column information.
Another recipe worth a look include secure client-server communication using the ExtendedSSLSession interface, making use of the keytool, a serverside keystore and a client side trust store.
A new nested class, ProcessBuilder.Redirect, has been introduced to provide redirecting of input and output of external processes - useful for interacting with other executables and scripts.
I think chapter 9 is another chapter all developers will want to read.
Chapter 10's recipes deal with further concurrency enhancements to the Java language, which have been getting more and more powerful since Java 5. The new fork/join framework allows a task to be split into smaller parallelisable chunks, and then combining the results.
Other useful recipes in this chapter demonstrate using the new ThreadLocalRandom class for more efficient random number generation in a threaded environment. And the ConcurrentLinkedDeque example shows how concurrent threads can safely access the same collection data.
Chapter 11 contains bit and bobs which don't fit in other chapters. The Handling null references recipe introduces the new Objects class which provides utility methods for object comparison, null checking and hashing.
The JavaBean enhancements recipe shows how to use the new Expression class to programatically create and execute Java statements. Also the Introspector and BeanInfo class provide a new way of determining a classes' methods and fields without using the Reflection API.
Overall, I think this book is good in places, but repetitive and difficult to work though in others. About half the book is devoted to paths, files, filesystems and I/O, which I'm sure could be slimmed down a bit. I'd recommend using the book as a reference to consult rather than a book to pick up and read cover to cover. Java 7 New Features Cookbook is definitely worth a read, and I will be using the things I've learned from it in future.
Lots of features have been introduced in Java 7 and the authors have covered most of them.
The target audience of this book are experienced Java developers who are familiar with writing programs in Java 5 and beyond and not for newbies to Java. Most of the recipes revolve around I/O i.e. File, Paths , Streams concurrency - which means a previous knowledge of these concepts are essential.
The book contains 11 chapters:
covering core language improvements like using String in switch, using the diamond operator for constructor type inference etc, to various recipes related to Java I/O, to GUI improvements, event handling to JDBC enhancements.
Each recipe follows a standard structure describing how to grasp the concept thru code. It is not necessary to read from start to end, the reader can jump into any recipe and read it.
Also most recipes includes caveats and gotchas which are immensely helpful for the developer.
What could have been improved:
Code examples are very basic. The authors could have taken better interesting examples to illustrate the concepts.
The code blocks are not reader friendly. The font, the formatting etc is sub-standard. This is the crux of the recipe and developers hate to see their code badly formatted.
Examples could have been less repetitive. Seems like the authors were in a hurry to release the book :)
A little bit history on Java versions. This helps readers to refresh the memory and sets some context.
Something on RIA Deployment toolkit, Custom classloaders, Garbage collector etc
Easy to read and understand. Worth picking up. Highly recommended for someone who wants most of the new features in Java 7 in one place with code examples.
Most recent customer reviews
For web applications, for new network programming features, and for the graphical interface you will...Read more
Author/s : Richard M. Reese, Jennifer L. Reese
Publisher : Packt Publishing
Category : Beginning Java
Review by : Jeanne...Read more