Ahoy, mateys. Gather ye 'round the scuttled water butt and I'll tell yer a tale or two. My name is Craig Jones, and this is my personal weblog. I also blog in two other places: For computer producity tips, see my posts on codejacked.com. For my thoughts on software development and business, see my company weblog.
Friday, September 09, 2005
I Blog, Therefore I Am Better
Thursday, September 08, 2005
"Head First" Book Sometimes Makes My Head Hurt
To wit, the whole pizza store analogy in chapter 4 (to illustrate factory method and abstract factory) is flawed. For one thing, that’s just not the way you’d model a pizza business in any actual software that I can imagine. For another, the differences between a New York pizza factory and a Chicago pizza factory are too subtle/trivial to make for an effective illustration of why you would need to subclass anything (much less use a factory to manage the subclasses). A much better example, as everyone in my group agreed, would have been an application that needs to offer up a consistent set of functionality to users who are accessing it in wildly different ways: one’s in a web browser on a desktop, another is running a cell phone app, another is using a touch-tone phone, and yet another is using a voice-activated headset. All the client code knows is that, for example, it needs to ask a multiple-choice question and obtain the answer. It’s up to an abstract factory to provide the client with a set of classes that can do that, in the context of the selected user-interface, in whatever way is necessary.
To a lesser degree, the Starbucks coffee example at the beginning of the book suffers from the same too-hip-to-be-effective syndrome, although I do think that the remote-control example for the Command pattern in chapter six is dead on.
For any novice who is reading this book without the benefit of a study group, I highly suggest that you find at least one other programmer who is experienced in design patterns to explain why/if/how the examples are lacking.
Wednesday, June 29, 2005
Wax On, Wax Off – Red Bar, Green Bar
So I can only imagine how it seems to the rest of my team, for whom automated unit testing is a new concept. The level of drudgery involved in retrofitting a legacy app with a test harness rivals the chore of waxing Mr. Miyagi’s deck. All I can tell my teammates is that it’s good practice. Soon, writing unit tests becomes a habit, and then, eventually, it becomes pure instinct. Attack from the right? Wax On! Attack from the left? Wax Off! Add a new feature? HTTP-Unit! Change a business rule? JUnit! Keep it up, and that black belt will arrive in no time.
Wednesday, June 22, 2005
Copying SQL Records within the Same Table
You may or may know that this can be done with a single INSERT INTO statement if you use an embedded SELECT statement in place of the VALUES clause. The hard part is that you cannot just use SELECT * FROM table WHERE ... becuase the * would pick up the key field (e.g. DepartmentID) along with all the rest. So, you have to list every field in the table by hand, except DepartmentID. You would specify the new value as a constant ("B") instead.
The "trick" is that you can probably find a tool that will generate the INSERT and SELECT statements for you. In my case, I'm using the Query Analyzer that comes with Microsoft SQL. In the explorer pane, navigate to the table. First, right-click and choose the option to generate an INSERT script and send it to the clipboard. Paste it into your favorite editor. Next, right-click and choose the option to generate a SELECT script and send it to the clipboard. When you paste this snippet into the editor, do it so that it replaces the VALUES... part of the INSERT statement. Finally, change the field name of the key field in the SELECT statement to the appropriate constant.
Labels:
programming
The Cobbler's Children Have No Shoes
Wednesday, February 16, 2005
"Building WebApps with Tapestry" - 2/22/05 7pm
Here is the official meeting announcement:
This month Vladimir Drndarski of Maxim Software Corp. (www.maximsc.com) will show how to build web applications in Java using the Apache Tapestry framework (a JSP alternative). As a recent convert from Delphi to Java, he'll introduce the topic from the ground up focusing on freely available open source projects that'll get you started quickly and for free. To start, Vladimir will show the Eclipse IDE and compare it to Delphi. He'll then discuss several Eclipse plug-ins that are must haves when working in Tapestry. And finally he'll delve into Tapestry itself. If time permits Vladimir will give an overview of the Hibernate persistence layer and give a quick demo of its use in Maxim Software's latest website, Oovie.com.
Vladimir Drndarski is co-founder of Maxim Software Corp. and the co-creator of Oovie.com (www.Oovie.com) and CollectorStreet.com (www.CollectorStreet.com).
The OCDUG meetings are held at Red Brick Software, 1301 East Lincoln Avenue, Orange, CA 92865. [Directions]
Saturday, January 15, 2005
Pres. Lincoln's Farewell Address
Saturday, January 01, 2005
Orange County Poker Meetup
Subscribe to:
Posts (Atom)