Sunday, May 19, 2013

Hibernate Made Easy: Simplified Data Persistence with Hibernate and JPA Java Persistence API Annotations 1st edition, Cameron Wallace McKenzie



I bought the book two weeks ago and just finished reading it. First off, the bad. The author says he hates books with errors and assures us that there are no errors in this book. Well, he's right. All the code from the book works perfectly. The problem is that you have to type every single line of code yourself. You could try to download the source code. But remember that assurance from the author? Well, it only applies to the book. Cause I can assure you that some of the downloadable code was completely off.

Now the good. This is the best Hibernate book I have ever read. I've gone through Hibernate Quickly and Java persistence with Hibernate. The problem with most Hibernate books is that its written by eggheads who have no idea how to speak to normal people. So they have a hard time explaining ideas in their books. Cameron on the other hand, has a knack for explaining a difficult subject matter into an easy to understand form. Not only that, but his examples make sense. The first chapters are spent on an example with only one table. He doesn't introduce more tables until the reader is fully confident with the subject matter. This is perfect because the reader does not get bombarded with too much complexity until they're ready. The last 3 chapters are spent explaining a full relational db with multiple tables. By this time, if you read every chapter, you'll fully understand how the app works and what each line of code does. You can easily grab everything you've learned here and start using Hibernate for your own apps.

For me, this Book was a game changer. I will never write another app with SQL statements. Cameron, if you read this, please start working on a Spring book.

So why 4 stars instead of 5? I just hate copying and typing code from a book. I'm a programmer not a secretary. The author promised no errors. That oath should apply to the downloadable code not just the code in the book.

Even though I'm new to Hibernate, this book was a fast, informative read. The author has a casual style that makes reading the book more enjoyable...to a point. But, there are problems. My two biggest issues were:

1. This book uses Hibernate 3.2.5. The latest version (as of this writing) is 3.6, which I, of course, installed. However, not being knowledgeable about the various releases, this turned out to be a huge mistake. 3.6 has some very big changes which made the installation instructions in the book almost useless. Most of the files named in the book are no longer there (the annotations module has been merged with the core, for example), some of the main classes used in the book don't seem to be there anymore, and even the configuration files are different now. I don't blame the author...this stuff just happens to tech books over time, and I could have just gone back and installed the earlier version to save myself this grief. I just wish I had not been the first person to pay over $50 for this book before realizing it has reached this state, and warned others. And this sort of thing is extremely frustrating to a new user that wants to get things rolling as quickly as possible.

2. Something I'm seeing a lot more recently in various forms of literature are obvious typos, grammar and punctuation errors, and attempts at being contemporary through the use of pseudo-words. Now, I'm no grammar Nazi, and I'm not perfect at all, but sprinkled in amongst the many typos in this book is the far too frequent use of the pseudo-word "kewl." At first I figured the author was trying to be funny, then I thought he might be using it in an ironic fashion, but after it reappeared ad nauseum, it got incredibly annoying. Making the typos even more annoying is the fact that the author mentions in the preface that he self-publishes, and so doesn't have the resources others might have to check for typos, but that this also allows him to make frequent updates to his text. This appears not to have happened. And at the very high price I paid for this book, I expected more quality. So, regarding this second issue, I would like to apply to the book the following pseudo-noun: Fail.

If you still want to the book, you can buy it on the author's website for $9 less than Amazon.

Hibernate Made Easy is such a great book, mainly because it's a learning guide, so the author really does his best teaching you in a very nice way and easy to read. After I've read it I greatly increased my Hibernate knowledge. To be sincere I thought Hibernate was harder.

The book starts teaching you how to set-up a database (MySQL) and Hibernate itself, which might be very useful if you never heard of Hibernate, because there are some files to configure. Then it proceeds in a very contextual way, that is, from the basic to more advanced topics, that's really important and often is not present in technical books.

About the topics in the book, I think the most important ones are covered, of course there much more topics in Hibernate, but as he clearly states, this book is a learning guide, not a reference book. All the CRUD(Create, Read, Update, Delete) operations, which are known to be the four basic operations in programs are very well explained with a lot of examples, especially the Read, dealing with search for objects in your database and the awesome Criteria API. The annotations are also very well covered, with very good and simple examples. Some patterns like Data Access Object (DAO) and Factory are covered, which might be very important in a decent JEE persistent application.

Maybe some people might think the examples are too basic, well, that's true, but this is a learning guide, so I don't think is a bad thing. The same to other more advanced topics.

So to conclude, the author has a very humane aspect of writing, he considers you a human-being not just a brain that stores data. And that's extremely important when you're learning something. The writing is very direct (not dozens of pages explaining the little details) and clear. Full of examples and good coverage of Hibernate. Definitely recommended!

I hope the author, Cameron McKenzie, can publish other titles.

It is actually a well done tutorial, but very short and dealing only on the easiest and most basic aspects of Hibernate...and most importantly nothing is said in this book about how to use hibernate in a real world application...
The level is that of a good online tutorial introduction, but nothing more. And in fact you can find most (if not all) of the content of the book on the author's website, hibernatemadeeasydotcom. Go give a look there, and if you really care about spending $50 for having the website content printed in a little booklet, well, go ahead..
Also the code download for the book is nowhere to be found, and you will have to email the author (which , I have to say, did answer my request quite quickly )to get a "secret link" to code that is anyway far from complete, working or even presentable.
Finally let me say that the whole idea of a quick & easy intro to hibernate is flawed. After "Hibernate standardization" to JPA a beginner is much better off learning standard and portable JPA techniques rather than the proprietary Hibernate tools and configurations. You might need to explicitly use Hibernate for advanced or specialized operation not covered by the standard, but even then , you 're certainly not going to get any kind of help from this "book".
If you 're interested in learning JPA techniques go for:
Pro JPA 2: Mastering the Java(tm) Persistence API (Expert's Voice in Java Technology)

or the old but still valuable:
Enterprise JavaBeans 3.0 (5th Edition)

and if you really need to dive deeper into Hibernate (get yourself some long duration oxygen tanks ;) and go for:
Java Persistence with Hibernate

This book is exactly what the title states. It makes hibernate easy. It does not delve into more advanced topics, but that is left for other hiber books. I 1st read Java Persistence with Hibernate and it was too much for me, and I was not able to find another book that did not use xml for configuring hibernate (other than the .cfg.xml). I wanted a book using annotations. I mean, java5 annotations have been out for years, there is no need for xml anymore to define mappings. This book uses annotations exclusively. There is some repetition, more than I would like, I would prefer some of those pages cover more topics. The one-to-one and one-to-many and many-to-many are very well explained, better than any other source I read. The example at the end gets a bit more involved with generics and DAOs, that too is excellent and explained slowly. My only criticism is that for the high cost of the book, there should be some online additional content. Many authors have additional chapters for further reading in pdf form, please Cameron, throw us a few more chapters, your writing style is excellent and I'd love to learn more about hibernate in this easy to read fashion. In conclusion, I really needed to learn a hibernate foundation so that I could understand more advanced hiber topics, and this is the PERFECT springboard. I am now going to purchase some of the more popular books with some confidence in my hiber understanding.

The book arrived just in 3 days from Amazon, that too during thanksgiving season. Well, the first time I saw that package, thought something wrong, may be I purchased a wrong item or something, because the book is so small. For a technical book with lots of good example as specified, I expected this book to be little big, but for my dissapointment.

Pros: If you love reading a novel in one sitting, well, here it is. After reading the first 2 chapters, you would realize that the author or we could call him a novel character, is sitting with you, holding your hands and making you write ABCD of hibernate. Yes, the examples are so simple that, if you know Java little bit, you are on the fly. In fact I didn't even tried to experiment those examples because I know for sure that works.

Cons: If you are of those persons who agree that the high pricing in kindergarden makes sense, then you are going to like this book. All the examples in this book are too easy and are the most basic ones. If the author had given more examples, it would have been better. I finished this book just in 2 days, can you imagine, its supposed to be a technical book. And now I feel like someone who bought a high price gadget which hs is not going to use.

Product Details :
Paperback: 442 pages
Publisher: PulpJava (April 25, 2008)
Language: English
ISBN-10: 0615201954
ISBN-13: 978-0615201955
Product Dimensions: 8.5 x 0.9 x 5.5 inches

More Details about Hibernate Made Easy: Simplified Data Persistence with Hibernate and JPA Java Persistence API Annotations 1st edition

or

Download Hibernate Made Easy: Simplified Data Persistence with Hibernate and JPA Java Persistence API Annotations 1st edition PDF Ebook

No comments:

Post a Comment