Pro JPA 2: Mastering the Java™ Persistence API
by Mike Keith, Merrick Schincario
Date Read 4/2010
If you’re learning or planning to learn JPA 2, you must own this book. Why? It’s the most complete book on the subject out there. It’s like a JPA bible.
Just a warning: It’s not an easy read. You will most likely have to read some (if not all) chapters at least twice. Some even more. For your first read, it will probably feel dry. Only after you learn by doing, by practicing, you will start “getting it.” This was at least my experience. I really started seeing the power of the book after reading selective chapters again. But of course, your experience might be different.
This is your JPA 2 bible. JPA 2 seems easy on the surface. But if you’re doing a project at work and it requires some advanced mapping, for instance, it’s not so trivial. The nice thing about this book is that it covers the advanced topics as well. And it shows you plenty of examples.
Few missing pieces. Cache coverage is light. Not much to it. Sometimes I felt that a full example, rather than a snippet, would be more appropriate. A few times I had to search the internet to get it to work. And as I mentioned before, this book is not an easy read, be prepared.
Excellent job by the authors. Excellent resource on JPA2, which I think is a great ORM spec.
What is Maintanable Code?
Maintainable code has several characteristics. In general, code is said to be maintainable when it is all of the following:
- Understandable – Someone else can pick up the code and figure out its purpose and general approach without a walkthrough by the original developer.
- Intuitive – in the code just seem to make sense, no matter how complex the operation.
- Adaptable – The code is written in such a way that variances in data don’t require a complete rewrite.
- Extendable – Care has been given in the code architecture to allow extension of the core functionality in the future.
- Debuggable – When something goes wrong, the code gives you enough information to identify the issues as directly as possible.
Very well said, Mr. Zakas!
Being able to write maintainable code is what distinguishes you as a programmer. It’s a difference between a craftsman and an apprentice.
I’ve just starting learning and using it, but I can already say: wow! It’ssome powerful stuff. I’ll go even further, if you are doing any webdevelopment, whether you work on front or backend, you should learn theframework. It will make you a better developer and make your lifeeasier. Plus, it’s arguably the most popular webdev framework. You’ll probably have to work with it at some point.
jQuery does require a bit of a learning curve. If you see the syntaxfor the first time, it might scare you. It looks cryptic, perl like.But once you know how to read it, it’s really not difficult.
There are many ways of accomplishing the same thing in jQuery. Somemore readable than others. This is where you can show your skills, yourcraftsmanship. As I have written before, it is always easier to write complex code, code that is harder to maintain. Programmer’s love complexity. But you should always write code for others to read and modify. That’strue in any language, but especially important in ‘criptic’ syntax. Butthis is what sets you apart from others, no?
I’m learning jQuery. I think it will help me accomplish things faster. It will make me a better software developer.
Here’s are some of the resources I’ve come across on jQuery.
jQuery in Action — excellent book on jQuery
Learning jQuery – another excellent book
Simplify Ajax development with jQuery, good article
Visual jQuery – a very good resource, you’ll probably spend a lot of time on it
It’s been some time since we had an update to the HTML language. Actually, it’s been years! After such a long time, things are starting to heat up again. HTML 5 is the next worked-on version. By reading this article, below, I got a glimpse of what’s coming. What can I say? A LOT of changes are coming. Nice improvement, in my opinion.
Hypertext Markup Language (HTML) 5 introduces new elements to HTML for the first time since the last millennium. New structural elements include aside, figure, and section. New inline elements include time, meter, and progress. New embedding elements include video and audio. New interactive elements include details, datagrid, and command.
ReferenceNew elements in HTML 5
Good news for Linux advocates! Dell will be shipping computers/laptops pre-loaded with Linux! To me, this is crucial for wider adoption of Linux, which I’m waiting for.
I came across this (interesting) post, 2007 Goals by Frank Kelly, and pondered… and came up with my own 2007 goals.
Deepen my Java knowledgeThere are still some features of Java that I don’t know, some quirks I’m not aware. In 2007, I plan to read Thinking in Java 4th edition in full. Maybe another book as well. I am also planning to purchase a good book focused on the new features in Java 6.
Get up to speed with Java ConcurrencyI have already started on this goal. I’ve read several articles/book chapters already. I’m finishing the chapter in Thinking in Java. I received Java Concurrency in Practice. I will master this beast.
Get more comfortable with J2EEI’m not a big fan of the heavyweight J2EE, but the new JEE 5 is different and I think it’s a good technology to learn. But before I actually delve into it, I would like to get myself more familiar with the old J2EE and run sample applications on an app server.
Get up to speed with HibernateI have used Hibernate on several projects. I know how it works. But I don’t know it in detail. There is a new book, Java Persistence with Hibernate which covers Hibernate 3.2. I will buy it and get some more detailed knowledge in Hibernate.
Learn Ruby and Ruby on RailsI already have 2 books on the subject, Learn To Program and Web Development with Rails, 2nd edition. I have another coming my way — I was selected to review a book as part of a Javalobby book-reviewing team, Rails for Java. I should get my hands wet in this technology and since my host supports RoR, maybe I can develop a project that I’m thinking about.
Read another book on PatternsWow, patterns are proving to be a tough beast to handle. I think I have a good grasp on the GoF patterns but I don’t use many of them and …. I forget. There is a new book on the subject, Design Patterns in Java, which looks good to me, and which will also refresh my UML skills.
Read 12-15 booksMy goal is to read a 300-page book every month. I have been doing that since last year and I shall continue.
Apply the knowledge I learnI read a lot, but a lot of that knowledge I easily forget. I need to change the way I learn. I need to start applying the knowledge that I learn. That means creating small projects with the new technologies that I learn. That means I need to actually practice my new skills. That’s the only way that I know that I’m actually going to gain a deeper knowledge of the subjects and make sure I don’t forget it easily (or not as easily as before).
Write at least one blog entry per weekThere are weeks where I have more than one entry and weeks where I don’t have any. I need to change that. Having a successful blog means updating it regularly. I shall update this blog at least once every week (have at least 3-4 entries per month).
All in AllIt looks like a busy year ahead. But I feel comfortable and confident that I will reach most of the goals. What I have started doing in the last several months helps me a lot. I started waking up at 6AM and dedicating the first hour to reading. By doing this, I get an uninterrupted hour where I am not tired (with a cup of coffee). This is working great for me so far.(I never thought I could be an early riser, but I really enjoy it.)
I have not done any SOA development yet. I’ve just been reading and hearing a lot about it. I’m reading the Enterprise SOA e-book at ACM.org now (my first on SOA; so far it is a very good book) and I just want to share some of my SOA views.
I think the Service Oriented Architecture (SOA) holds great promise. The key word is “holds” because, as of now, I think we mostly have a lot of hype surrounding it. There is too much hype and not too much actual implementation, because SOA has some issues that need to be adressed/resolved. There are certainly bits and pieces actually being developed, but that’s not really service oriented architecture.
The potential of SOA is there. It enables reuse in dimensions never seen before. It enables the usage of different technologies. It gives you the ability to bring old technologies/projects back to life.
What I see happening is that you have a project that provides some functionality that you would like to reuse. Instead of putting this functionality inside your project (as a dependend project) you make it a service. This does not couple you with the project as before. And the project that you are dependent upon has its own life. It can change the DB, it can change the language it is implemented in, and a lot more. One thing that does not change is its public face, the API, the service contract. This really is exciting.
I think there are two very big problems, though. First, the complexity. It is still very complex to actually develop the self standing services. We have so many different techniques, and they do not really like to talk to each other easily. I am still lost in the midst of all the available technologies. I think that’s changing and I hope a clear, easy to develop/understand standard will appear.
The second problem is speed. Calling a service is a network call. In the traditional way, where you have a dependent project, it is a regular function call. The difference in speed in the two is huge, I don’t know the details but I’d guess a service call is at least 100 times slower. To mitigate this issue, good caching is needed. In this case, the service calls would be cached on the client. This way, only the first call for each service parameter values would incur the call expense. Not too bad. Certainly possible. But this just adds more complexity.
SOA promise is certainly there. It will happen. Probably in the next couple of years, in the next decade. There are still major issues with it, as I see it. But the major obstacles in my mind are complexity and speed.
I did not attend JavaOne this year (I wish). Eric Armstrong, blogger at Aritma.com, did. Not only did he attend the conference, he put together a very good blog entry about the cool stuff that is happening in the Java world, as well as in the software world.
He does a very nice job. I totally agree with what he’s saying. He covers AJAX, Hibernate, J2EE, Groovy vs BeanShell (I might have to learn them).
Here is a summary of the entry:
Reference:JavaOne 2005: Wrap Up by Eric Armstrong