Skip to content


Two more OU assignments down…

I’ve just uploaded my second assignment for M362, Developing concurrent and distributed systems, six days early. Which I’m extremely happy about as I didn’t start the first assignment until the week before it was due!

This week I also received my marks for the second assignment for M256, Software development with Java, in which I scored 91%. This assignment was also submitted six days early, although it’d been finished for a few days before that, but I’m reluctant to submit assignments too early just in case there is any last minute errata.

The good news is that it seems I’ve finally managed to make up the time I lost (frittered away) during the first few weeks of both courses, which is good news as I’ve now passed the halfway point and the exam dates have been published!

Both exams are in Cambridge from 1000-1300, with M362 on the 12th of October and M256 on the 21st October.

Posted in Formal Study, Uni.

Java EE 5 Development with NetBeans 6…

Java EE 5 Development with NetBeans 6

Title: Java EE 5 Development with NetBeans 6
Author: David R. Heffelfinger
Publisher: Packt Publishing
Price: £30.99
ISBN: 978-1-847195-46-3
Pages:
 
 
 
 

This book has been written for Java developers with no knowledge of NetBeans or Java Enterprise Edition (Java EE), who wish to develop Java EE applications using NetBeans. It promises to take the reader on a tour through the most important parts of Java EE programming, using screenshots and instructions to demonstrate how using NetBeans and its features can save time and enhance their development experience. Sounds good, but does Heffelfinger deliver and can someone with only a basic understanding of NetBeans and Java Standard Edition (Java SE) learn anything? Before I attempt to answer this question, here’s a quick summary of what’s in each of the books chapters.

Chapter 1, Getting Started with NetBeans, takes the reader through the process of downloading, installing and configuring NetBeans, before deploying the Corporate Travel Centre sample application that ships with NetBeans, to ensure that the GlassFish application server and JavaDB have both been correctly configured within the NetBeans environment.

Chapter 2, Developing Web Applications with Servlets and JSPs covers how to create Java EE web applications using Java Server Pages (JSP) and the Serverlet API, before looking at form based authentication as a means of securing web applications. Finally, the reader is shown how they can use the NetBeans HTTP monitor to keep track of what’s happening to their web applications.

Chapter 3, Enhancing JSP Functionality with JSTL and Custom Tags introduces the JSP Standard Tag Library (JSTL) as a way of building more readable and maintainable JSPs by relying less on JSP scriptlets. The two main areas covered are, how to use the Core and SQL JSTL tags, with the former showing how to decide which page to display (conditional logic) and how to display collections through the use of loops in JSPs, while the latter deals with inserting, retrieving, updating and deleting database data.

Chapter 4, Developing Web Applications using JavaServer Faces introduces the reader to web frameworks; once again Heffelfinger mentions some of the alternative non-standard web frameworks, before explaining that JavaServer Faces (JSF) was introduced as part of the Java EE specification.

Chapter 5, Interacting with Databases through the Java Persistence API guides the reader through the intricacies of using the Java Persistence API (JPA) via an example that uses the Model-View-Controller design pattern. During this process, NetBeans is used to generate JPA classes, JPA entities from a database and a complete JSF application from existing JPA entities.

Chapter 6, Visual Web JSF Development takes the reader through writing their first Visual Web Application, in a predominantly drag, drop and bind fashion. However, Heffelfinger points out that this isn’t always the quickest way to work as using code completion can be a faster option for some tasks.

Chapter 7, Implementing the Business Tier with Session Beans covers how to use session beans, including how to implement Aspect-Orientated Programming (AOP) via interceptors and how to use the Enterprise JavaBean (EJB) Timer Service to periodically invoke a session beans methods.

Chapter 8, Messaging with JMS and Message Driven Beans deals with the Java Messaging Service (JMS) and focuses on how the reader can use NetBeans to generate the required boilerplate code, leaving them free to focus on the applications business logic.

Chapter 9, Web Services introduces both SOAP and the Representational State Transfer (REST) before focusing on the former and guiding the reader through creating both a web service and a web service client. Once again NetBeans is used to generate the majority of the required boilerplate code.

Chapter 10, Putting it all Together takes the reader through the process of creating an Enterprise Project which takes advantage of some of the technologies explored in the earlier chapters and reinforces the learning experience.

Finally, there are two appendixes, A. Debugging Enterprise Applications with the Netbeans Debugger and B. Identifying Performance Issues with NetBeans Profiler. Both are brief in nature, but provide enough information to get the reader started.

As you may have guessed, Heffelfinger has written this book to guide the reader through creating the various applications using a step-by-step method, making extensive use of screenshots and highlighted code snippets to supplement the instructions. Heffelfinger doesn’t expect the reader to mindlessly follow these steps though, as he takes time to briefly explain about technologies and why we need to do certain things. An example of this is where Heffelfinger mentions alternative products before using a product that ships with NetBeans, in chapter 1 MySQL and Postgres are both mentioned and while they are popular RDBMSs and arguable more so than the Java DB, using either in this context would have added little of real value, and in all probability they would have simply been an unnecessary distraction. I appreciated the logic behind this approach and was pleased to see it used throughout the book.

Each of the chapters uses their own applications focusing on their particular technologies, which works well as it means the reader doesn’t have to move from one chapter to the next in a predefined order. Heffelfinger repeats relevant notes where they are required to aid the reader, or direct them to the relevant information should they choose to read the book out of sequence. I personally started at the beginning and worked my way through the book, however, I have no doubt that this flexible approach would benefit more knowledgeable readers who are interested in specific Java EE technologies or NetBeans features.

Alas this book isn’t perfect, to me if a book is based around the step-by-step style then I feel I should be able to create the applications from the book alone and not be forced into downloading the code samples. The step-by-step style was the case for the first couple of applications, however, once we moved onto Servlet Development in chapter 2, Heffelfinger opted to leave out a simple JavaBean, explaining that it was a simple JavaBean and therefore it was not shown, but at only thirty one lines of code, including comments was this really necessary? Unfortunately, this was not an isolated incident and the policy was prevalent throughout the remainder of the book.

As for the downloaded code samples themselves, I personally found these to be of a mixed quality, which isn’t to say the code or applications themselves are poor as they certainly achieve their aims, but is more a reflection of the randomness of whether they would run without modification or configuration, and while I accept that for some, configuration is required, it would have been beneficial if these steps were documented, possibly in an appendix. An example of this can again be found in chapter 2, where the Form Based Authentication code sample requires the Enable Authentication Constraint checkbox to be ticked, while the next code sample for Creating a JSP Fragment in NetBeans, comes with this checkbox already ticked. Despite this I managed to get all of the code samples, working without any major issues, except for those in chapter 9 which continue to frustrate me.

I enjoyed reading this book and found it easy to read, with the content pitched at the right level for its target audience, developers new to Java EE 5 and NetBeans. That isn’t to suggest it’s the only book on NetBeans or Java EE 5 that you’ll ever need to own, but then again I don’t believe this is Heffelfingers aim.

Rating: 4/ 5

Posted in Book Reviews, Java.

Devoxx 09…

Registration for Devoxx 09 the java community conference is now open. The event takes place in Antwerp, Belgium from the 16th-20th November, and consists of the University (first two days) and the Conference (last three days).

The call for papers, tools in action, Birds-of-a-Feather (BOF) and Quickies is also open.

Posted in Java.

Book Reviews

For a while now I’ve been working on my first book review, Java EE 5 Development With NetBeans 6 by David R. Heffelfinger. This turned out to be more difficult than I initially anticipated, however, Colin Mackay and Craig Murphy both members of Scottish Developers, gave me some useful advice and as a result my book review is almost finished.

One area I hadn’t considered until today was whether to score the books I review and if I do, how should I score them?  After a little research it appears that the most commonly used scoring mechanism is to allocate a score out of a range of marks, for example:

  • ITNOW (BCS magazine) use a rating out of 10
  • VSJ (IAP magazine) use a range of 5 smiley faces
  • LibraryThing uses a range of 0.5 to 5 stars (including half stars)
  • PC Pro magazine uses a range of 1 to 6 stars (including half stars)
  • Craig Murphy uses a rating of 1 to 5 (including half marks)

After giving this some careful consideration, I’ve decided to use a scoring system with a range of 1 to 5 and no half marks. This enables me to give each mark to a descriptive word, as listed below:

  • 1 – Awful
  • 2 – Poor
  • 3 – Average
  • 4 – Good
  • 5 – Excellent

Posted in Book Reviews.

Open University update…

Over the last couple of weeks I’ve made a determined effort to get back on schedule with my two OU courses, and as a result last night I submitted my second assignment for M256 Software Development with Java six days early!

Yesterday, I also attended my second M362 Developing concurrent distributed systems day school, at Cambridge Regional College. As always it was an interesting session, especially chatting to fellow students about their experiences of other OU courses.

Posted in Formal Study, Uni.

Smalltalk in London – 6th July 2009

Via a tweet from James Robertson about this blog entry of his, I’ve discovered that London Geek Nights are having an evening of Smalltalk at the ThoughtWorks UK Office in London on Monday, 6th July 2009.

Hopefully, I’ll be able to make it into London for this…

Posted in Smalltalk.

I’m a prize winner…

A while back I completed the VSJ survey, which included a section for the 2008 VSJ Reader Awards and a section to gain feedback on the VSJ magazine. As with many of these surveys a prize incentive was offered to encourage readers to complete the survey, which I paid little attention to at the time.

However, last week I received a copy of O’Reilly’s Enterprise Recipes with Ruby and Rails in the post. This confused me initially as I don’t use Ruby or Rails at all, let alone in an enterprise environment! The lack of an invoice further confused me, but on flicking through the book I discovered a letter congratulating me on winning the book, although it failed to mention the VSJ.

Posted in General.

Etape Caledonia…

Last weekend I took part in Etape Caledonia, an 81 mile cycle sportive on closed roads around Highland Perthshire as part of the Royal Air Force team. As this the only closed road event in the UK it attracted just under 3800 riders, with the RAF team starting in the first wave at 0700 on the Sunday morning, in a light drizzle!

Unfortunately after only 4.9 miles, I had the misfortune to take a tumble on the first descent, which resulted in me becoming entangled with Adey another RAF rider. I’ve put it down to an element of over-enthusiasm combined with a wet road and a ninety degree bend! However, it resulted in gravel rash (ouch!) on my right hip and elbow, and some sort of sprain(?) to my left knee and right bicep. However, after walking down the remained of the hill I was able to resume riding, albeit at a more sedate pace, especially on all the remaining descents!

Just after the second rest area (at around the 40 mile point), I started to pass a LOT of cyclists at the side of the road repairing punctures and it soon transpired that they were being caused by tacks on the road. These were maliciously spread and Tayside Police have already made an arrest and the accused appeared before Perth Sherrif Court earlier today.

As a result of the tacks the organisers made the decision to halt the event at the third rest stop, before it was resumed with a ‘controlled descent’ behind a police car and the removal of around seven miles from the route. As a result the timings although interesting are a bit false as people had wildly differing amounts of punctures and were individually affected by the enforced stop, with those starting earlier being stopped for longer.

In a way, the tacks added to the social side of the event as I and many others met and chatted with cyclists we’d otherwise never have met, while inner tubes and patches were freely offered both by Mavic (one of the official event sponsors) and cyclists in general.

I must point out that all of the locals I passed were out cheering us cyclists on, they certainly made me feel special as we passed them!

The only downside for me personally is that I am currently unable to swim and have therefore missed the Brize Norton Sprint Triathlon. I’ve also cut back on all my training to try and recover a bit quicker…

Posted in Cycling.

LRRA 2up TTT…

Yesterday I competed in the Lincolnshire RRA 2up Team Time Trial, with Jack Russell. This was not only our first Team Time Trial but we only met half an hour before the event started!

Despite this we managed to complete the 15.5 mile course in 44 minutes and 17 seconds, which placed us 26th out of the 34 starters. We are certainly happy with this as Jack was targeting under 45 minutes (I was simply aiming to finish!) and the headwind for the first six miles was particularly unpleasant.

Steve Forman from Lincsracephotos.co.uk was at the event taking photos of the competitors. He has kindly given me permission to use his photo of Jack and I here, copyright of course remains with Stephen Forman. Just in case you haven’t worked it out I’m the one at the back!
Jack Russell and I competing in the LRRA 2up TTT

Posted in Cycling.

A new 10 mile TT PB…

I’ve just received the results from the St. Ives Cycle Club 10 mile Time Trial last night. It was warm with just a little breeze and I managed a new personal best of 28 minutes and four seconds, which is exactly one and a half minutes faster than two weeks ago! This means that I averaged 21.34mph over the course, although the fastest rider last night completed the course in 22 minutes and 30 seconds, averaging 26.67mph!

Posted in Cycling.