Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry.
> Shop now
Each recipe comprises step-by-step instructions followed by an analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or look at the list of recipes and refer to them in no particular order. It is packed with useful screenshots to make your learning even easier. The book is aimed at Java EE and EJB developers and programmers. Readers should be familiar with the use of servlets in the construction of a web application. A working knowledge of XML is also desirable.
{"itemData":[{"priceBreaksMAP":null,"buyingPrice":49.49,"ASIN":"1849682380","isPreorder":0},{"priceBreaksMAP":null,"buyingPrice":34.69,"ASIN":"0596158025","isPreorder":0},{"priceBreaksMAP":null,"buyingPrice":47.01,"ASIN":"1430219564","isPreorder":0}],"shippingId":"1849682380::UNouOO4%2BGHbLaNowuXuzupZ%2B3yR4NOvmQsdFS6KrGoouBAF%2F8k2cyNCIUUE0yOFqGtBltFuDHTGc71GhfhkPofUDhAwPq%2BC5BX%2BWaEga4zgh5C3Bx1B8QQ%3D%3D,0596158025::CAXPDTqPjZ33l4RubgVoei0FmRfm4W%2FLH%2B8KGsZVfSP%2FeQcwsH5%2BBrflubzkER46KaGQjVlXqx0oP3W1JrVFc95d2DD5fhdcomh6D%2F%2BXrsCfRUOwHi1QWQ%3D%3D,1430219564::pDhzEG614VtGuQWXO%2BIYGqN0A6mOkkgfWgFiy3hxF3esTymHxCScMjJF%2BMcTOshPQbfBbcrfaJ4rIDqyng%2F0xOWWKgXnjhHDskWwQ4WM2Yk%3D","sprites":{"addToWishlist":["wl_one","wl_two","wl_three"],"addToCart":["s_addToCart","s_addBothToCart","s_add3ToCart"],"preorder":["s_preorderThis","s_preorderBoth","s_preorderAll3"]},"currenyCode":"USD","shippingDetails":{"xz":"same","yz":"same","xy":"same","xyz":"same"},"tags":["x","y","z"],"strings":{"addToWishlist":["add to wishlist","Add both to Wish List","Add all three to Wish List"],"addToCart":["Add to Cart","Add both to Cart","Add all three to Cart"],"showDetailsDefault":"Show availability and shipping details","shippingError":"An error occurred, please try again","hideDetailsDefault":"Hide availability and shipping details","priceLabel":["Price:","Price for both:","Price for all three:"],"preorder":["Pre-order this item","Pre-order both items","Pre-order all three items"]}}
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 4 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 insight into industry applications. He has published numerous papers and has developed courseware for a variety of topics including advanced Java technologies.
In short, "EJB 3.1 Cookbook" by Richard M. Reese did not live up to my expectations. Any, at all. I found some interesting bits (esp. "Using interceptors with timers" in Chapter 9 and "Creating your own interceptor" in Chapter 12), however they don't merit reading the entire book as the time it took was not worth it. My biggest gripe is that the book's often too basic, focusing on irrelevant things, and trying to follow a fixed structure of recipes often repeats itself, and thus boring. It's tempting to skim over the pages or get sidetracked. It's by no means engaging.
The book is a compilation of, what the author called, recipes. All the receipts meant to create a cookbook, and while they were "simple", they weren't "incredibly effective", quoting from the book's front cover.
I assume cookbooks are meant like this - they provide recipes, and while you may find out how to achieve a goal, you won't find out whether it's the most effective or appropriate in a given scenario. You find no answers on why it's done that way or why it was possible at all.
According to "Who this book is written for" (see the book's website or the closing cover) "the book is aimed at Java EE and EJB developers and programmers." I could hardly disagree with that general and vague description - it says nothing about their experience that I believe is crucial for this book to shape expectations before giving the book a go.
I don't think it aims at people who are just starting their journey into EJB 3.1 and/or Java EE 6 as there's too much loosely placed explanations of different approaches and one has to be very careful not to follow the recipes in their entirety.
On the other hand, I doubt that it aims at developers who have already spent some time with EJB 3....1 (where I belong to), either - it's too basic and clattered with servlets as the way to showcase the EJB 3.1. There's, however, no recipe with EJB beans bundled in a WAR. That would greatly have eased a few recipes and, moreover, ditch a couple of pages. I'd rather avoid using servlets for every sample, especially where there's more servlet/HTML code than EJB one. It's not uncommon.
I'm thus troubled to clearly point out who the book is really aimed at. Many pages cover basic Java programming material (it's clearly visible in chapter 12 "EJB Techniques" where java.util.Date/Calendar, java.util.logging and String manipulation are presented, or when @Override on page 10 is explained), whereas there are pages with more advanced EJB 3.1 concepts - timers, transaction, security or interceptors. Glancing at the table of contents it's easy to get deceived into thinking the book will cover a lot of advanced stuff, but it doesn't take long to realize that the table of contents looks promising, while the material covered is not as intensive as it may have been considered.
The book uses NetBeans 6.9.1 and GlassFish 3.0.1, but they're almost invisible as the topics don't touch too many container- or IDE-specific aspects. Just a few pages should not spoil the book for readers who use other tools (provided the other shortcomings did not already).
Unfortunately, it's easy to find a typo in the text or the code snippets. The editing process leaves much to complain about.
Sentences like "Mozilla Firefox or Google Chrome can be used to display the output of servlets" (page 3), "Message sent successfully", "Message sent successfully2" (page 21), or explanation of how the jar tool works (in chapter 11, pp. 345-351) are, say, how the book is written - there are 400 pages yet 100 would make it a better reading.Read more ›
EJB 3.1 Cookbook is at best an average book. The information in the book is very densely packed, but often repetitive and sometimes tangential to the current topic being addressed. The information in the book is presented in recipes - short how-to examples focusing on a specific JavaEE / EJB 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. Some of the code examples, especially at the start of the book, are trivial; and the explanations of how the code works are sometimes no more useful then reading the JavaEE 6 javadoc.
The book covers the full range of EJB beans and the Java Persistence API, with about equal time being spent on features new to EJB 3.1 and existing features from 3.0.
It's difficult to say who the books target audience is. It doesn't provide enough guidance to developers new to Java, but spends too much time covering some of the basics which more experienced EJB developers will already be familiar with. If you're already experienced with EJB 3.0 development and need a handy reference for existing annotations, and want to get a good understanding of the new annotations in 3.1 and how to use them, then this book might be useful.
This book was laborious 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.
NetBeans 6.9.1 and GlassFish v3.0.1 are stated as requirements for using this book. In practice, specific features of these products are barely used. There is no reason why you couldn't use Eclipse and JBoss AS, or any other code editors and application servers which support EJB 3.1....
Chapter 1 is an introduction to Enterprise JavaBeans, Dependency Injection and the Java Naming and Directory Interface. It covers creating a simple Stateless session bean and accessing its functionality from a variety of clients. Developers who are familiar with EJB development will find this chapter a waste of time. Developers new to EJB and JNDI will find it baffling and of no immediate practical use, I'd recommend skipping this chapter.
Chapter 2 covers session beans - Stateless, Stateful and the new Singleton bean. It provides examples of how to use the new @Startup and @DependsOn annotations to control order of singleton initialisation, concurrency and locking, controlling initialization and local and remote interfaces.
The last and most useful part of the chapter uses the @Asynchronous annotation to schedule background processes, and demonstrates the Future and AsyncResult classes.
Chapter 3 explains Message Driven Beans and introduces Queues and Topics. Good program design and possible performance enhancements of separating object production from consumption is illustrated. More interesting and useful recipes are presented towards the end of the chapter, but the first five which deal with different message types are almost identical.
Chapter 4 introduces Object-relational mapping and the Java Persistence API. Familiar JPA concepts and annotations are covered as well as new annotations for temporal validation @Past and @Future, regular expression validation using @Pattern and integer and boolean validation.
Chapter 5 builds on chapter 4 and introduces the Java Persistence Query Language and the new Criteria API. CRUD operations using JPQL are covered extensively, but the new Criteria API is only given one recipe. I would have liked as many pages covering the Criteria API as there were on JPQL, the increased performance and type safety of this new feature are things I would like to know more about.
Chapter 6 contains very useful information on transaction processing. The defaults of Container Managed Transactions have always been sufficient for me, so I was interested to learn more about transaction types and Bean Managed Transactions.
EJB Security is covered in chapter 7. The concepts of users, groups and realms are introduced and specific features of GlassFish are used for the first time to prepare a File Realm. Declarative role based security using annotations is covered, as well as controlling security programmatically when annotations are inadequate.
Chapter 8 introduces Aspect Oriented Programming and the @Interceptor annotation. I've never been impressed with AOP, it always seemed more trouble than it was worth, but this chapter shows how simple EJB 3.1 makes it. There is some good information in this chapter, it demonstrates well how AOP can simplify code by moving functionality not central to a business method outside of the method.
Chapter 9 - Timer Services demonstrates automatic/declarative timers, implemented using annotations and programmatic timers using the TimerService class.
Chapter 10 covers SOAP web services using JAX-WS, which will be familiar to EJB 3.0 developers, as well as creating RESTful services with JAX-RS.
The pros of using XML deployment descriptors in environments which require more dynamic configuration are highlighted in chapter 11. Also covered is the usage of the 'jar' command to examine JAR and WAR file contents, and a quick overview of the java classpath and class loading.
Chapter 12 ends the book with recipes which are applicable to Java programming in general, not just EJB development. The chapter contains general good practice tips like using a logging framework instead of printing to System.out, not leaving empty catch blocks, using BigDecimal to avoid rounding errors for currency, and avoiding string concatenation performance inefficiencies by using StringBuilder.
Overall, I think this book is OK. I'd recommend using it as a reference to consult rather than a book to pick up and work through end to end.
I think the book is suitable for developers looking to brush up on the newest EJB annotations, but because of this, much of the book will be old news to many readers. Even the information I felt was relevant and interesting to me can easily be found on the Oracle website in the form of The Java EE 6 Tutorial and javadocs.Read more ›
EJB 3.1 Cookbook is aimed at Java EE and EJB developers who need a reference guide that addresses the challenges provided by EJB3.1 in the form of "how-to" sections. At just over 400 pages, the book provides many recipes that will be of benefit to the majority of developers using EJB technologies.
The book is broken down into 12 chapters which form a natural progression starting with simpler recipes through to more advanced EJB techniques. Each chapter in the book starts off with an introduction detailing the subjects to be described in the rest of the chapter followed by the recipes themselves. Each recipe follows a standard "pattern", starting with a title (e.g. "Handling a map-based message") and a description of what the recipe is trying to achieve. Recipes are then broken down into sections:
* "Getting ready" provides an overview of how the recipe works. * "How to do it..." provides a full description of how to achieve the recipe's objectives. * "How it works..." explains how any code samples are pulled together and explains any code referenced in the previous section. * "See also" identifies any other recipes that may include pertinent information to assist the reader in their understanding.
EJB 3.1 Cookbook is an excellent resource in an EJB developer's library. It's not the sort of book you pick up and read from cover to cover rather a useful resource that you pick up when you think "How do I do xxx in EJB?". With over 100 recipes this book is recommended to developers using EJB technologies.