Design Patterns

The class I’m teaching this week and next is a massive, customized combination of Design Patterns, JSTL, JSF, Spring, and Hibernate. It’s going to be an adventure.

Today, though, we were digging into patterns. Design patterns has usually been my favorite course to teach. If teaching is all about giving people the ability to do things they couldn’t do before, then patterns is one of those fundamentally enabling topics that helps all your code everywhere. It also helps people understand code from others that they’re reading, not to mention the Java APIs.

We talked mostly about Abstract Factory, Factory Method, Singleton, Strategy, Template Method, and Observer. Suffice it to say that it was a rather long day. I happen to like all of those and use them regularly. There are other creational patterns, too, like Builder and Prototype, that our materials didn’t dig into but I discussed with the students.

Yup, they’re fried, and it’s only Tuesday. It’s a standard dilemma. We have lots of material to cover, but it’s just hard to absorb that much that quickly. The students are roughly intermediate Java developers (with a wide standard deviation), but still sometimes the Java stuff itself is a bit of a challenge to them.

I brought up the Head First Design Patterns book and they seemed interested. I have mixed feelings about the whole Head First series. Kathy Sierra herself once wrote that people who criticize the books are often people who already know the technology. That’s probably true. The Head First EJB book was wonderful and got me through the Sun Certified Business Component Developer exam. On the other hand, I didn’t like the Head First Servlets and JSPs book at all. But, then again, I already knew servlets and JSPs when I read the book.

Personally, my favorite patterns book is still Applied Java Patterns by Stelting and Maasen, even though it’s getting a bit dated by now (published in Dec, 2001).

[The Mets blew a great opportunity. They had men on 2nd and 3rd with one out and didn’t score. They’re down to three outs left in order to keep from going down 3 games to 2.]

Incidentally, the students use IBM’s Rational Application Developer 6.0 in their jobs. That’s normally okay, but the design patterns materials I have use Java 5 generics, enhanced for loops, and other cool features. For this part of the class we’re using Eclipse 3.2 with the ever-popular MyEclipse 5.0 plug-in. That should really pay off later when we get back to the server side.

What happened to IBM’s tracking of Eclipse developments, anyway? When they first released WSAD 4.0 (WebSphere Studio Application Developer), they also released Eclipse 1.0. They stayed exactly 3 numbers apart for years after that, going to WSAD 5 (Eclipse 2), WSAD 5.1 (Eclipse 2.1), WSAD 5.1.2 (Eclipse 2.1.2), and even RAD 6.0 (Eclipse 3.0). Now Eclipse has moved to 3.1 and then to 3.2 and we’ve gotten nothing from IBM. I’ve heard rumors of a RAD 7, but I don’t know what that’s all about.
Okay, the move to Eclipse 3.1 was big and difficult because that’s the first version that really worked with Java 5. WebSphere still doesn’t get Java 5 at all, which is one of the many reasons I tend to prefer JBoss (now a division of Red Hat).

Speaking of annoyances, Hibernate 3.1 works with Java 5, but doesn’t use Java 5 generics. As ugly and awkward as the generics implementation is (try making a Map where the values are also a List some time), I find it very annoying that I can’t use generics in my code because query.list() and criteria.list() methods both return List of Object. It’s back to casting again, plus I can’t use the for each loop.

Hibernate 3.2 is a hairs-breadth from release. I hope they’ve fixed that, but the betas don’t seem to show it.

The Mets went one-two-three in the 9th. So much for that. As long as the Yankees have been eliminated, I’m happy. 🙂

About Ken Kousen
I teach software development training courses. I specialize in all areas of Java and XML, from EJB3 to web services to open source projects like Spring, Hibernate, Groovy, and Grails. Find me on Google+ I am the author of "Making Java Groovy", a Java / Groovy integration book published by Manning in the Fall of 2013, and "Gradle Recipes for Android", published by O'Reilly in 2015.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: