Archive for java

Oh OO, thou art a heartless bitch

Posted in Design Issues with tags , , , , , on August 11, 2010 by moffdub

Well, it has finally happened. I am dreaming about defects in our code. Dream in code? Dog, I live dream-in-code every day.

Time for a familiar argument, a familiar decision. You have a blank slate. You must define some data transfer objects for your consumer based on some requirements. You provide an interface that takes in one of these data structures and returns an XML representation of that data structure.

And, for the sake of this discussion, you are using Java’s XMLStreamWriter as your XML framework (I know, I know, there are much more uber l33t ways, but this was the most straightforward and painless way for you in the time-frame you were given).

Simple. SIMPLE. Right?

Option 1

By now, your nudge, your twitch, your instinct is to define an appendTo(XMLStreamWriter) method to each object, which either writes a simple tag or calls appendTo(XMLStreamWriter) on its constituents:

Read more »

How-to: train a decades-experienced Cobol programmer in Java

Posted in The Industry with tags , , , on September 9, 2009 by moffdub

Today we bring you a quick how-to guide on training a Cobol programmer in the ways of Java and object-orientation in general. But first, a quick programming (pun intended) note: this Saturday I will be off and we’ll be posting a best-of Nowhere To Run because I will be away at a Tea Party in Washington, D.C..

Now, back to the day’s events. You’ve just been tasked with training the new Java developer. This developer has a decade or more experience writing Cobol and SQL for any variety of database systems, but the only Java he’s ever seen was at the four-day training course he just completed. He won’t be working on your project. What are you to do?

Read more »

Lord help us, he’s at it again

Posted in Design Issues with tags , , , , on August 5, 2009 by moffdub

Yes, a welcome break, I’m sure, from posts filled with Smalltalk listings and tales of solitary sanity. We are here again–what? What? What is it, Mr. Commander? Mmmhmm. Yeah. Mmmhmm. What–what do you mean “another post that cites a design ugliocity and then proceeds to point out the ugliocities of all of the alternatives”? Yes, that’s exactly what I plan to do! It’s my blog and I’ll OCD if I want to.

Now, on with it. Here is an object design I have to deal with every day against my will:

Read more »

Follow

Get every new post delivered to your Inbox.