RSS

Web Development

Programmer's Bookshelf Newsletter - June 2005


Book Reviews

Patterns, Unit Tests, and Linux Clusters

Review by Gregory Lapouchnian

Eric and Elisabeth Freeman, with Kathy Sierra and Bert Bates, have written Head First Design Patterns, which covers the same material as most other books on design patterns, but presents it in a different format. When I first saw the book, I was skeptical because of the diagrams and cartoon-like cover and inside pages. Text is at a minimum in Head First Design Patterns, with most of the book consisting of diagrams, pictures, Java code snippets, and just a bit of text scattered throughout. But by the time I finished reading three chapters, I was enjoying the visual approach the authors took. The book is written with a sense of humor and feels more like a conversation than a lecture. That's not to say the book doesn't have valuable content--it is just focused content presented in a nontraditional manner. In particular, the authors focus on patterns that seem to have been utilized the most in practice--Singleton, Factory, Decorator, Observer, Facade, State, Proxy, Adapter, and the like--since the publication of the Gang of Four's Design Patterns: Elements of Reusable Object-Oriented Software. All in all, Freeman et al., present 12 patterns in detail and briefly introduce another nine at the end. Overall, I enjoyed how Head First Design Patterns was written and found myself flipping pages and absorbing the combined visual and textual content on the new page and not missing the good old paragraph one bit.

Patterns tell you what code should look like, but you still need to make sure you've built it right. This is where the idea of test-driven development (TDD) comes in. Paul Hamill's Unit Test Frameworks presents an overview of the tools that let you follow this style of development. Hamill begins by explaining the basics of unit testing and the architecture behind the xUnit family of test frameworks. Five of those frameworks are covered in more detail. The original JUnit for Java, CppUnit for C++, NUnit for .NET, PyUnit for Python, and XMLUnit for XML. For each, Hamill provides an overview of the architecture, examples, and a list of available assert methods. The last third of the book is taken up by JUnit and CppUnit class references. To be truthful, I found Unit Test Frameworks to be light on real content. I was disappointed not to see mention of using unit tests in more complicated scenarios, where applications consist of more than just a couple of classes. Too many of the pages were taken up by reference material. In short, I don't know what a reader would gain from reading this book that isn't readily available online. Joseph Sloan's High Performance Linux Clusters provides a wealth of information on the subject of Linux clusters. Sloan guides you through the decision-making process for building cluster computers, installing the right software, and writing the programs to solve a particular problem. After an introduction to the basics of cluster architecture, hardware, and environments, Sloan presents detailed instructions for installing openMosix, OSCAR, and Rocks. openMosix extends the Linux kernel to allow processes to migrate between the nodes in a cluster to balance the load. OSCAR and Rocks are cluster kits that help you install all the required software at once. The third part of the book contains detailed descriptions for various software packages used to maintain clusters, such as cloning new nodes, cluster management and scheduling, and parallel filesystems. In the last section of the book, Sloan covers cluster programming, including examples of using the Message Passing Interface (MPI) library.

Even as someone who is not planning to build a Linux cluster in the near future, I felt confident because of the detail of Sloan's installation instructions. I did not find myself feeling lost or unsure of how a particular package should be installed or used, as can be the case when some authors decide to mumble over important instructions. The number of topics covered in the book is also impressive. Someone new to the topic of clusters is given the information they need to get started and advice on how best to approach this rather complex undertaking.

Head First Design Patterns
Eric Freeman, Elisabeth Freeman, with Kathy Sierra and Bert Bates
O'Reilly & Associates, 2004
638 pp., $44.95
ISBN 0596007124

Unit Test Frameworks
Paul Hamill
O'Reilly & Associates, 2005
198 pp., $29.95
ISBN 0596006896

High Performance Linux Clusters with OSCAR, Rocks, openMosix & MPI
Joseph D. Sloan
O'Reilly & Associates, 2005
350 pp., $39.95
ISBN 0596005709

Gregory Lapouchnian is an undergraduate in the computer science department at the University of Toronto.

Greg on Software Books

Review by Gregory V. Wilson

The older I get, the more I find myself trying to make sense of things. Crazy, I know, but I don't just want my code to work anymore--I want to understand how it works from top to bottom, and how it fits into the grand scheme of things.

Judging from this month's books, I'm not the only one who feels this way. On the top of the list is Joel Spolsky's Joel on Software, which collects some of the witty, insightful articles he has written over the past four years. If you're a developer, Spolsky's weblog is a must-read: His observations on hiring programmers, measuring how well a dev team is doing its job, the API wars, and other topics are always entertaining and informative. Over the course of 45 short chapters, he ranges from the specific to the general and back again, tossing out pithy observations on the commoditization of the operating system, why you need to hire more testers, and why NIH (the "not-invented-here" syndrome) isn't necessarily a bad thing. Most of this material is still available on-line, but having it in one place, edited, with an index, is probably the best $25.00 you'll spend this year.

Budi Kurniawan and Paul Deck's How Tomcat Works is a much narrower book, but seems to be driven by the same need to make sense of things. The book delivers exactly what its title promises: a detailed, step-by-step explanation of how the world's most popular Java servlet container works. The authors start with a na-ve web server that does nothing except serve static HTML pages until it's told to stop. From that humble beginning, they build up to a full-blown servlet container one feature at a time. Each time they add code, they explain what it's doing and (more importantly) why it's needed. Their English is occasionally strained, and there were paragraphs I had to read several times to understand, but this book is nevertheless an invaluable resource for servlet programmers who want to know more about their world.

John Goerzen's Foundations of Python Network Programming is superficially different, but at a deeper level, very similar. Where Kurniawan and Deck look at one way to handle one protocol, Goerzen looks at how to handle several common protocols, including HTTP, SMTP, and FTP. Goerzen also doesn't delve as deeply into how servers work, concentrating instead on how to build clients that use these protocols.

The similarity lies in the approach. As with How Tomcat Works, Goerzen builds solutions to complex problems one step at a time, explaining each addition or modification along the way. He occasionally assumes more background knowledge than most readers of this book are likely to have, but only occasionally, and makes up for it by providing both clear code and clear explanations of why this particular function has to do things in a particular order, or why that one really ought to be multithreaded. I've already folded down the corners of quite a few pages and expect I'll refer to this book often in the coming months.

Joel on Software
Joel Spolsky
APress, 2004
362 pp., $24.99
ISBN 1590593898

How Tomcat Works
Budi Kurniawan and Paul Deck
BrainySoftware.com, 2004
450 pp., $49.99
ISBN 097521280X

Foundations of Python Network Programming
John Goerzen
APress, 2004
512 pp., $44.99
ISBN 1590593715

Gregory is a DDJ contributing editor and can be contacted at gvwilson@ddj.com.


Recent Releases

RFID Field Guide: Deploying Radio Frequency Indentification Systems
Manish Bhuptani and Shahram Moradpour
Addison-Wesly, 2005
263 pp., $39.99
ISBN 0131853554

This book is a comprehensive guide to planning, designing, and deploying RFID technology into your business.

The Grid: Core Technologies
Maozhen Li and Mark Baker
Wiley, 2005
423 pp., $85
ISBN 0470094176

This book explores the technologies that enable the Grid, explaining infrastructure, and offers practical examples to enhance the understanding and use of Grid components and associated tools.

Readings in Database Systems
edited by Joseph M. Hellerstein and Michael Stonebraker
MIT Press, 2005
865 pp., $55
ISBN 0262693143

This book provides a grounding in database research and a technical context for understanding recent innovations in the field.

Effective C++: 55 Specific Ways to Improve Your Programs and Designs, 3rd Edition
Scott Meyers
Addison-Wesley Professional, 2005
320 pp., $44.99
ISBN 0321334876

Scott Meyers has updated his classic C++ book to reflect the changes in the language over the past 15 years: This 3rd edition includes guidance on the design of effective classes, functions, templates, and inheritance hierarchies; applications of new "TR1" standard library functionality, along with comparisons to standard library components; and insights into differences between C++ and other languages (e.g., Java, C#, C) that help developers from those languages internalize "the C++ way" of doing things.


Contact Us

To contact Dr. Dobb's Programmer's Bookshelf Newsletter, send e-mail to Deirdre Blake, DDJ Managing Editor, at dblake@cmp.com.

All content copyright 2005, CMP Media LLC.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

DrDobbs encourages readers to engage in spirited, healthy debate, including taking us to task. However, DrDobbs moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing/SPAM. DrDobbs further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Best of the Web

Triple Buffering as A Concurrency Mechanism

Triple Buffering is a way of passing data between a producer and a consumer running at different rates. It ensures that the consumer sees only complete data with minimal lag.

Quick Read

Embedding GDB Breakpoints in C Source Code

Have you ever wanted to embed GDB breakpoints in C source code? Something like this:
printf("Hello,\n");
EMBED_BREAKPOINT;
printf("world!\n");

Quick Read

Writing Kernel Exploits

Why attack the kernel? Because it has a huge attack surface with potential for very interesting bugs. This presentation (pdf) takes a code-level dive into recently reported Linux-kernel exploits.

Quick Read

Compiling the JavaScript Engines

With growing demand for out-of-browser JavaScript (e.g., server JavaScript), a good knowledge of JavaScript engines is becoming more important.

Quick Read


More "Best of the Web" >>



Microsoft Web Development TV
sponsored by Microsoft

Enabling People and Organizations to Harness the Transformative Power of Technology