Slashdot Mirror


Holub on Patterns

James Edward Gray II writes "Apress sent me a copy of Holub on Patterns for review, and for that I'm extremely grateful, because this is a gem of a book I would not have liked to miss. Odds are, most object-oriented programmers will feel the same, so allow me to share the highlights." Read on for the rest of Gray's review. Holub on Patterns: Learning Design Patterns by Looking at Code author Allen Holub pages 414 publisher Apress rating 9 reviewer James Edward Gray II ISBN 159059388X summary Design Patterns taught through Real World Programs.

If I can level any complaint against this book, it's probably that the title doesn't properly convey the goodness locked within. Holub on Patterns is short for Allen Holub on Design Patterns. Allen Holub is a long time expert on Design and Design Patterns, so he's the man you want to learn it from. Still, if I could name this book, it would be Object Oriented Design Voodoo. (Note: This is probably why I don't work for Apress or any other publisher.)

The book's subtitle is "Learning Design Patterns by Looking at Code." That probably conveys the work's focus a little better and it also gives away one of the book's best features: sensational examples. (These examples are in Java, another area where Holub is a well-known authority, but the concepts taught apply to Object Oriented Programming in any language.)

Titles aside, this book really is the best work I've read on design patterns. If you don't already know, design patterns are the recurring patterns of object-oriented software implementations. Luckily, you don't have to know anything about them to read this book. The author covers many patterns in rich detail from the beginning. Even if you do know your design patterns well, I'll wager Holub still has a trick or two to impress you with.

Holub discusses patterns in their ideal pure form, but much more importantly he shows them as they occur "in the wild," with multiple variations. He covers the downside of each pattern, weights the trade-offs of using them, and even gives a handful of cases where he felt they were impractical. He does all this right in the middle of complex real-world examples so you can see each point he's making. That's actual programming, folks. The good, the bad and the choices we programmers make are well presented, and that's rare in a programming text.

The book opens with two chapters that more or less cover why we need design patterns at all. Did you know getters/setters are bad? Did you know that subclassing is dangerous? If you said No to either question, you need this book and these two chapters in particular will get you up to speed on good OO practices. This section of the book is mostly theory, light on examples.

The next two chapters (covering over 250 pages) make up the heart of the book. Holub examines two examples in exhaustive detail. The first is his implementation of The Game of Life. You've probably implemented that on your TI calculator, but Holub sure didn't. He admits that his implementation is "Toy Code," but it's a robust example that involves eleven design patterns. The second example is production code, a mini database complete with SQL interpreter. This code is also swimming in pattern usage, and Holub gives you the guided tour.

I've already said these examples are great, but that claim begs some elaboration. First, we're talking about hundreds of lines of code in many of these listings. These aren't the usual contrived junk. What's more, one class may be participating in multiple patterns. Making any sense of these examples would be almost impossible if the author wasn't flawless in explaining the key points and always dropping hints about what you need to notice. This isn't light reading. It's work, but the rewards are there and it'll pay off if you really spend the effort to understand how the code works.

Finally, the book closes with an appendix that gives more typical recipe-card style listings of all the design patterns discussed throughout the text. This is a nice reference after you've finished the tricky stuff. If you're new to design patterns, you might start here, before the book throws you into the lion's den with its massive examples.

Just in case I haven't sold you on this title yet, I better mention the gorgeous hard back binding. Brilliant and sexy. How can you beat that?

Holub on Patterns is a very approachable way to learn a lot about design patterns. If you already know how much patterns can improve your object-oriented programming, you'll really enjoy Holub's presentation of the topic. If you don't yet grasp Design Patterns or haven't enjoyed other works on the subject, you'll just have to trust me: You want this book.

You can purchase Holub on Patterns: Learning Design Patterns by Looking at Code from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

7 of 211 comments (clear)

  1. Self-defence lesson by Anonymous Coward · · Score: -1, Offtopic

    By: Mille

    Standing in front of her women's only self-defence young Julie
    smiled to herself when wondered if her group had the right stuff to
    join her special group. "OK! Listen up I want you to stand up and
    come closer and watch carefully what I am about to show you!" said
    Julie. The women slowly stood and moved forward to sit on the floor
    round Julie in the centre of the Gym. "This lesson is the most
    important part of your self-defence training and as far as I am
    concerned the most pleasurable part of the basic course. Those of
    you who do well in the lesson today will get a free introductory
    advanced self-defence lesson. Do you understand?" continued Julie.
    The women looked puzzled at each and nodded quietly that they
    did. "I want you to shout that you understand. BE ENTHUTHIASTIC!"
    snapped Julie. "Yes we do understand." Shouted the women. "Good."
    Said Julie with a smile on her face.

    Waving her right arm in the air she shouted "Ok, come in now we're
    ready for you." Shouted Julie. To the women's surprise a young man
    of about 18 walked through them and stood submissively in front of
    Julie. "Now I want you to watch what I do as this young animal
    tries to attack me. I don't want you to feel any guilt when you get
    your turn to do what I am about to do to this vile disgusting
    beast. In fact I want you to enjoy it as what I am about to do to
    it is for me one of the sexiest things I have done to a revolting
    creature like this." She then indicated to the young man that she
    was ready for him. He then made to move forward and shouted at her
    that she was to keep quiet and not resist him. The women in the
    group gasped in shock as her lunged forward and tried to grope her
    young firm breasts with both of his hands.

    Sighs and groans of pleasure erupted from all of the women as Julie
    quickly evaded him and gracefully swung her right foot back and
    sent flying with the beauty of a ballerina ramming her foot as hard
    as she could into his soft balls making him groan in pain and fall
    heavily with a loud thud. The group sat in silent awe as Julie then
    swung her right foot and kicked him hard in his stomach and head as
    he lay on the floor crying in pain. Looking round the group Julie
    savoured the cries of approval and applause she got from the
    women. "Now I want a volunteer to have a go at kicking a man in his
    balls!"

    All of the women thrust their hands high into the air and shouted
    to Julie to let them have a go at kicking a man in his balls. Julie
    just smiled and looked round the group and pointed at young Anne
    and told her to stand next to her in the centre of the
    group. "What's your name?" asked Julie. "Anne." The girl
    replied. "How old are you?" "I'm just 17." Replied Julie. "Have you
    kicked on of these vile creatures in the balls before?" "No."
    answered Anne. Julie looked at young Julie with amazement and
    muttered "You're a bit backward for a girl you know you should have
    kicked a beast in his balls by now. Any way you have a go." Julie
    dragged the man onto his feet and indicated him to attack Anne.
    Lunging forward the man made the same moves against Anne as did
    against Julie.

    She felt panic and fear at first as he moved towards her but to her
    surprise felt a surge of joy and power as she swung her right foot
    back as far as it would go and thrust it hard into his balls. As he
    fell back onto the fall she experienced an orgasm powerful that she
    nearly fainted. Standing over his prostrate body Anne felt giddy
    with excitement and couldn't stop herself from kicking him again in
    his balls as he lay groaning on the floor. Her pussy felt electric
    shock like pulses of sexual pleasure as her foot struck home onto
    his cock and balls. After she had finished Julie put her arms round
    Anne and pulled her close to her and kissed her on her neck and
    rubbed her breasts and stomach onto Anne's. As she held Anne
    against her she whispered into the gir

  2. goat.cx links above. by Anonymous Coward · · Score: -1, Offtopic

    n/t here, but do not use above links

    1. Re:goat.cx links above. by mpost4 · · Score: -1, Offtopic

      it is a hack to make slashdot think it is google.com, but remember if it was really gmail it would read gmail.com not google.com

    2. Re:goat.cx links above. by numatrix · · Score: 0, Offtopic

      huh? Actually, the 'real' gmail is gmail.google.com. Check out the ssl cert for https://gmail.com/ if you don't believe me. I imagine it's done that way so all the google domains share the same cookie base.

  3. Too bad she's a theo-con by Anonymous Coward · · Score: -1, Offtopic
    Too bad's she's a neo-con... oops, sorry, in the 2nd Bush admin she is going to be a theo-con.

    Anyway, neither neo-cons or theo-cons are allowed to have sex the way god intended: whenever, whereever and in whatever way two consenting adults want to do it!

  4. Recipes? by Anonymous Coward · · Score: -1, Offtopic

    Does anyone know where I can find some recipes on the Internet? I thought I'd Ask Slashdot because you guys seem to know your way around the web!