New things are afoot

November 26, 2008 – 5:04 pm

Apologies in advance for my cryptic-ness, but I wanted to let everyone know that I’m working on a new project that could grow into something really cool.

Register the domain name. Check.
Set up the host. Check.
Install Subversion on my development machine. Check.
Install Trac on my development machine. Negative. (That installation is painful, to say the least.)
Install MySQL and SubSonic. Check.
Set up the Visual Studio 2008 project. Check.

There’s still so much to do. So, so much. I need to design the architecture of the application, design the database, and make some decisions about how I’m going to implement certain things.

I will start posting regularly about this project as it takes shape. All I can say for now is that I’m very excited and I’m having a great time.

(Also, note that this is my own project I do on my own time. It’s not my day job.)

Solving the Problem of the Data Layer

November 12, 2008 – 9:21 pm

On a warm May afternoon in 2005, I sat in a conference room with some very smart people. We were discussing things like reference architectures, SOA, Solaris containers, and code generators. As members of a skunkworks R&D team at the company, we had to produce, and we made some great things. But what I remember most from working in that group and attending that meeting is that while we looked way up into the clouds for the next big thing, our feet were on shaky ground: we rarely agreed on anything. For example, none of us agreed on how a data layer should be properly constructed in an enterprise application. One person thought the built-in .NET tools were best; those tools have since been deprecated. Another person liked the monolithic God Class approach, where one class provided everything. I thought the specialized ORM tool built by the company–a data layer builder of sorts–was the best choice, since it offered the most configuration and decoupling.

In my new role here in Iowa, I’m in a situation where the data layer in a production application is practically nonexistent. The core business logic exists in stored procedures, and stored procedure calls are crafted mainly in the code-behind class files for the various ASP.NET pages. There’s also some stored procedure and SQL code in a massive static class. This approach is a maintenance nightmare. As a consultant brought in to get the product under control, I have to find a way to standardize the data layer without making a negative impact on the product. Easier said than done.

Throwing out the stored procedure code appeals to the architect in me ("Let’s start all over!"), but the realist in me knows that that is a thing you should never do. Given that the code that uses the stored procedures in the ASP.NET project is repetitive, I figured that using ORM would best solve this problem. I chose SubSonic over other choices like NHibernate because SubSonic wraps the stored procedure calls in objects (it does the same for our tables and other database objects). Now all the features of our database, where the business logic tragically lives, are available to us in an object-oriented way. I can refactor the existing code instead of rewriting it, and preserve the stored procedures as they are. Calling a stored proc will no longer require string-heavy usage of SqlCommand. We can use DatabaseName.SPs.StoredProcName(typed parameters).

For example, say you have your web application configured to use SubSonic. Your database connection string is named PurchasingSystem. In your actual SQL Server database, you have a stored procedure called UpdateItemList and it takes two parameters, an integer identifying the product list to update and a string that is the name of the item. (Yeah yeah, not the best example in the world, but stick with me.)

The SubSonic-generated code will let you do this:

PurchasingSystem.SPs.UpdateItemList(1, "Gears of War 2");

That is so much simpler and easier to maintain than the alternative of using ADO.NET objects.

As the kids say, ActiveRecord and scaffolding FTW.

Back in the Saddle

October 14, 2008 – 4:15 pm

Over the past six months, I’ve been talking about process improvement, change management, Windows Workflow, and a few other items. I talked about my role as the enterprise architect for an organization and the responsibilities of that role. Well, I made a big change a couple of weeks ago: I left EDS, an HP Company and moved back to Des Moines, IA to continue my consulting career in an independent fashion.

This is an entirely different role, encompassing more software development and architecture than the enterprise focus I had previously, but if you read some of my past posts, you’ll see that this is where I want to be. I’m working with the Microsoft stack for my current customer, and I plan to post about my experiences with this project. There are many challenges ahead.

Innovation, Validation, and No Regrets

September 16, 2008 – 3:07 am

I am the proud owner of a new HP Pavilion tz2500 tablet PC. When I first got it, I had mixed feelings. I had wanted a tablet PC for a long time, mainly because I felt it could enable some positive behaviors toward notetaking and managing the plethora of ideas and projects I have. But when I first started using it, I couldn’t figure out how it was supposed to benefit me. I knew it was good, I knew it had possibility, but I had no idea what I should be doing with it. I saw the value of the possibilities but did not have an approach to the follow-through.

Most ideas and plans work out that way, don’t they? Something swims around in your head and you know it’s awesome, but when it comes time to make it happen, it’s just not there. This happens to me all the time. In fact, that very issue is what led me to the tablet PC in the first place.

Today I felt pretty frustrated with my decision. I began to find reasons to dislike my new tablet PC. It’s too heavy. The screen is glossy. There’s too much silver. I wanted to lay the blame for returning the computer on something that was wrong with it and not me.

I relayed these concerns to a good friend and colleague, who happens to be a tablet PC owner (a different model). He showed me how to use my tablet PC. He relayed its strengths, situations where it could prove valuable, things I hadn’t thought of. He helped me understand its value and reinforced my original reasons for getting the tablet PC. He told me about some great software. His opinions and assistance allowed me to accept the computer’s shortcomings (which I admittedly knew about before I bought it) and embrace its real potential.

Every innovator needs a validator, someone who can tell you when you’re wrong and when you’re right. Someone who can help you mold an idea into something real. Someone who is honest and forthcoming with opinions. If you look back on some of history’s great innovations, you’ll see a lot of partnerships (Brin and Page, Gates and Allen) and a lot of adversarial relationships (Edison and Tesla, Microsoft and Google). That’s the balance that allows us to trumpet our accomplishments, defend our decisions, and change our approaches. It forces innovation while celebrating it.

I’m writing this post on my tablet and after finding some really good applications for it, I am in love. I look forward to taking advantage of its full potential and using it to unleash some of my most persistent and longstanding ideas.

Learning as I Go Along

September 10, 2008 – 6:09 pm

One of the things I’ve always loved about working in this industry is the “breathing room” we give ourselves to figure things out on our own. Depending on the project or tasks, we’re able to draw on our experiences and knowledge to tackle problems of all sizes. To make things even better, we’re allowed—even expected—to acquire new knowledge at a blistering pace. And one great way to do that is to simply try.

Such as it has been the past few months as I built a tool in Visual Studio 2008, C#, and Windows Workflow. This tool, which I’ve mentioned here before, was created to serve two purposes: first, to help me keep my skills current and learn something new (namely .NET 3.0 and Windows Workflow) and second, to help simplify and automate the process of performing my weekly change management duties.

The work I’ve put into this project has resulted in a significant leap forward in my WF and .NET skills, as I had hoped and expected. The interesting side effect is that it helped me refine my change management process, showing me the areas where improvement was needed and where steps could be completely eliminated. The creation of the Windows Workflow was the catalyst for those changes. Through my technical trial and error, I was able to sort of redesign the process. From a certain point of view, the process changed to suit Windows Workflow, but the way WF is designed ensures that there’s not a tie-in between the process and the WF used to represent it.

The differences between the first iteration and the most recent iteration of the application are astounding. When I began this project, I didn’t use TDD or agile methodologies or any of that stuff of which I often sing praises. I sort of just jumped into it, learning as I went along, making mistakes and correcting them. Even in this late iteration, I’m finding things that need to be improved, bugs that need to be fixed, features that need to be added.

What struck me as the most curious product of this endeavor was the discovery that while my process became less rigid, the workflow for the process became practically ironclad. Each step in the workflow depends on the step preceding. While I had successfully decoupled the process as done by hand, I had created a monster of an inflexible beast that simply performed the steps in a predefined order, with no room for change or improvement. In other words, I had done it all wrong. Once I reached a point where I realized that the RFC documents absolutely had to be in the source folder before I could start working on the review because my application required it, I completely understood that I had shifted the inflexibility from my work to my workflow.

Thus, even as I feel like I’m near completion, I know that I have more work to do. The plus side is I have a working product that does what I need it to do, albeit inflexibly and unable to handle exceptions. That’s for future iterations, work that I am quite looking forward to.

Joy of Coding, Part II

August 27, 2008 – 3:33 pm

I decided to spend some quality time working on the Windows Workflow application I wrote to support the document workflow that is such a crucial part of the weekly Technical Review Board that I run for change management. The first couple of iterations of the application were pretty simple: it would take an Excel document as an input, along with some fields set by the user (date of the agenda, which RFCs to review [by number]), and then output an agenda along with a formatted Excel document to make reviewing the RFCs a little easier.

But there were still too many tasks done by hand. I knew more could be automated: extracting the RFC detail from the list into the agenda, creating the PDF packet, emailing it to everyone. Ideally, the application would have only one human step: actually reviewing the RFCs. So it would go through the process of bringing documents together, pause while I do my thing, and then resume with more creation and sharing of information.

I’m not quite there yet. It’s a side project so I can’t put too much time into it, but I do have a rough design in mind and, like so many little prototype one-off applications, this one will grow into an essential tool for this role.

And now for some interesting technical tidbits. I rewrote the Office integration piece to make it more stable and less resource-intensive, so I implemented the Excel and Word automators as Singletons, using a pretty simple IAutomator interface. Since I had started working on the Excel automator before the Word one, it had grown into some pretty gnarly code, while the Word automator was clean and well-designed, the product of experience. I stripped out a lot of unnecessary code, implemented the interface, and ensured only one instance of the Office COM objects were instantiated. I also added much-needed Marshaling code to release the COM objects when the whole thing was done. It’s pretty standard stuff as you move an app from simple prototype into more useful (and shareable) tool.

One thing that caught me up though was that the workflow kept spawning two copies of Excel. I couldn’t figure out why. I had thought that the Singleton pattern would ensure that wouldn’t happen, but what that ended up doing was skewing my attention from the root of the problem. I finally discovered that I stupidly called the Initialize() method twice, spawning that extra copy of Excel. I couldn’t find the bug because I thought I was smarter than that. As tools get more powerful and languages add more features, we easily get caught up in that stuff, forgetting the basic principles.

My computer math teacher in high school taught me skills that I still use today. One of those is the pencil test. With the pencil test, you literally use a pencil to point at each line of code on your screen, reading every bit of code one line at a time until you find an error. It made for some interesting debugging, but in those days of GW-BASIC, it was all we had. And that “pencil test” is what helped me find my silly Excel COM bug today.

The joy—and pain—of software development can only be summed up so simply.

How’s your day going?

August 13, 2008 – 6:26 pm

Years ago, when I first started working in the IT business at a small electric company in Texas, I had a coworker named Jim. Jim was in his 60s and had been an electrical engineer all his life, which in 1994 added up to about 40 years. He was enormously respected for his understandably dizzying knowledge of electrical engineering, especially when it involved transmission lines and substations.

My interaction with Jim was a support role. The electric company had computers on every desk, loaded with Microsoft Office and AutoCAD for the engineers. Jim would try to figure out how to solve his own IT support issues, and it usually resulted in things getting worse. For example, one day he called me and said that his mouse was moving around on his screen too fast. I sat down at his desk and instantly realized that his mouse pointer acceleration was set to the maximum. I guess he had been playing around with it and set it too high. Typical engineer!

Jim used the same greeting with everyone he saw during the day: “How’s your day going?” It always resulted in the same canned replies, like “fine” and “great.” I didn’t realize the philosophical implications of Jim’s question until much later: what am I doing and what I have accomplished so far.

Today I have evaluated 11 change requests for technical errors, changed the enterprise architecture diagram for a solution assessment, and fixed a bug in the C# code for my workflow application. That’s what I’ve accomplished so far.

But what am I doing? How is the rest of my day going? How can I ensure I’m giving my customer a maximum return on their investment? What can I do to ensure that when I get home, I can tell my fiancee that I’ve had a good day?

The answer has two parts: first, how can I track what I’m doing, and second, how can I know when it’s done. To-do lists, notes in OneNote, task list in Outlook, sticky notes on my monitor, Follow Up tags on my emails, or a mental list just a few of the many ways people track the ever-expanding list of Things to Do. I’ve tried them all. I settled on using different tools for each job. I use Excel to track the change requests I’m reviewing. I use Outlook to manage the tasks associated with following up with change builders. I use OneNote to track the lifecycle of certain documents that undergo a lot of changes from meeting to meeting.

In information technology, the management of Things to Do has wide-reaching influences and often requires a substantial investment in tools and people. Everything from the business processes to the schedule to the project manager to the people doing the work has to be meticulously tracked, verified, and managed. This is one of the cornerstones of good IT governance.

Hats off to you, Jim, wherever you are now.

The Joy of Coding, and Code Leadership

July 28, 2008 – 5:46 pm

I love coding. I always have, and I think I always will. When I’m writing code, I’m having fun, I’m satisfying my intellectual curiosity, I’m creating something, I’m accomplishing a goal, and I’m getting instant gratification. I just love to code. The thing is, I don’t get to do much of it anymore. As often happens to developers in IT, I’ve moved from the code-producing job into the application-management job. My responsibilities moved out of the of the design/develop phase of the lifecycle and into the deployment/management phase.

You can’t keep a good coder down, so I find ways to inject my true passion into my current role. I use code to solve problems that are exposed by my job. For example, I created a Windows Workflow application to help me manage the technical review process for change requests, which are my business responsibility. Rather than have a coding role mandated by the needs of a development project, I code tools that help me—and the people I work with—get things done. It’s not any more or less noble than any other coding job; it’s just, well, different.

And because I will always be a coder at heart, I’m looking for ways to extend my knowledge of software development into my role in the PMO, and future roles that I might drop into in the future. So I’m reading a book called Code Leader by Patrick Cauldwell, which came recommended by Scott Hanselman (who wrote the foreword), and quite luckily, I won in a raffle at the Lansing Day of .NET last month. I had been looking for a book that summarized the modern responsibilities of a software development manager so it was quite fortuitous that the book dropped into my lap. It covers a variety of topics that are the hot-button issues of today, like continuous integration, test driven development, dependency management, and Model-View-Presenter. I’ve been pretty pleased with it so far. I had never really understood continuous integration until I read about it in this book. Discussions about CI always leaned toward the details of CruiseControl rather than the theory behind CI.

If I can be a strong development manager and combine that with my IT management skills, then I can achieve my goal of quality software that works. Maybe that should be capitalized. Quality Software That Works. QSTW shouldn’t be a dream. QSTW shouldn’t be a product of processes and meetings. It should just be. And the path to QSTW is established in books like Code Leader and Code Complete.

I am always looking for ways to improve my own coding and the projects under my watch. Keeping up with the changes and new technologies in the software development world is a constant challenge. But that’s a topic for another post.

My To Do List

July 12, 2008 – 5:56 am

Today I finally received my copy of Pro WF 3.5, which is a great book about Windows Workflow Foundation (WF) and how to fully take advantage of it. I’m very excited about WF and I see it becoming the focal point of application development in .NET shops over the next couple of years. I’ve already created a WF application for my current role (it helps me manage the change control technical review process), and I’m always improving it. I might even rewrite it as a state machine workflow.

Oh boy do I have a lot of things on my plate. Let’s see:

  • Studying for my CAPM certification
  • Studying for my ITIL v3 Foundation certification
  • Mastering Windows Workflow so I can accurately present it
  • MCSD.NET by the end of the year
  • More posts on this blog

It’s good to have a lot of things to do!

I return to the office on Monday after a nice week’s vacation. I stayed at home and did some things I had been meaning to do for quite some time, like wash my car and organize my study. I know it’s not much of a vacation but it’s important to step back once in a while and manage your own personal life processes.

I have some good ideas for future posts that I will turn into reality in the coming days. I hope you check back often!

Don’t hate the game, hate the process

July 10, 2008 – 11:25 pm

I’m not a big fan of the one-size-fits-all approach to processes. I think that processes can be good, like when they formalize the way people do things and establish a single point of understanding. I think that processes can be bad, like when they’re so complex and unrelenting that they get in the way of actual work.

Some people think processes are the silver bullet to every problem. “That wouldn’t have happened if a process had been in place and followed,” they say. Other people think processes are a waste across the board. “We did just fine before management started making us follow this process, and now it adds three weeks to our work,” they insist.

The big question is, how do we meet halfway? How do we show the value of business processes while not forcing people to choke them down? How do we establish guidelines for business process management and still let people do their jobs in the way they are most productive?

The Daily WTF had a recent post (albeit fictionalized) about how a blind adherence to processes completely eclipsed common sense. I can’t personally believe that the people in that story would be so ignorant as to lose an entire day’s work from such a simple matter, but at the same time, the story does have a point: IT stuff is not trusted as much as they should be, and the checks and balances in place can cause more trouble than they’re worth. That’s not the fault of “business process management.” It’s the fault of the people who put the processes in place, ensure they’re being followed, and carry out the work involved. In other words, everyone.

On the other side of the coin, there are untold numbers of success stories that involve business processes that work. We never pay attention to the things that go right; we only care about the things that go wrong. Never mind that the electricity stays on when you pay your bill, or that your car hasn’t been repossessed because the bank paid your check to your lienholder. We ignore these things because we take the processes for granted, and because they are someone else’s problem.

What do you do when the process is choking the life out of your work? You change it. I’m reminded of a story I heard in a computer science class I took a long time ago:

I worked for a shipping company for several years in the data processing department, and since I did a good job and my programs worked, I eventually got promoted to supervisor. My job duties included everything I was already doing, with some extra responsibility over the other data processing clerks.

One Monday I came into the office and my manager called me into his office. “John, we need to talk about one of your clerks, Bill. The computer says he has processed an average 24 large shipments over the past three weeks, and the minimum threshold for data throughput is 30 shipments.”

I knew he had been having some trouble at home with a sick child, so I didn’t push him to work harder. And I didn’t even know there was a “minimum threshold for data throughput.”

“We want you to let him go,” my manager said. I was shocked and tried to change his mind, but he had the hard data showing my coworker’s productivity.

A week later my manager called me into his office. “I see you didn’t let Bill go. I’m glad you didn’t because his output exceeds the minimum by a large amount. But next time, talk to me before you go against what I say.”

I couldn’t fire Bill. He wasn’t the problem. It was the program. Some programmer had made an arbitrary decision to set a default value for a variable to 30–the number of days in the month of June, when the code was written–and I changed it to ‘0′. The “minimum threshold” that my boss was talking about was the initializer for a counter that tracked all processed large shipments by a user. Since the code was testing for values less than that “threshold,” an exception was thrown. Someone had written a business process around the code, instead of the other way around.

I think the moral of his story is “common sense prevails.”