Incommunicado

I’ve joined twitter with the username RobinDotNet. If you want to chat me up, you can join twitter and ping me!

I’ve been a bit incommunicado for a while, because I’ve been back to working major hours. I’m still answering questions in the MSDN ClickOnce and Setup & Deployment forums, though. It’s important to me to keep up with that, because very few people other than MSFT answer ClickOnce questions there, and I seem to be able to help people. When I’ve needed help, people in the C# and WinForms forums, etc., have helped me, so it’s my way of giving back to the community.

Why have I been working so much? I’m working on streamlining and standardizing the software in the backend at GoldMail. You know how you take over a job from someone, inherit a bunch of code, get no turnover, and have to figure it out? Welcome to my world. But I always love a challenge. The problem was that a lot of this code was the kind of thing that you write when you’re in a hurry and you’re just trying to get it to work, and you never have time to go back and clean it up. You know what I mean; we’ve all done it. (Actually, I’ve never done it, I just work more hours. 😉 ) The code worked, but it wasn’t optimal, and some was overcomplicated. Plus, some of it was still in .Net 1.1.

Also, someone had taken all of the private webservices and tucked them into one Visual Studio solution, and same for the public webservices. The problem with that is if you want to branch one of the private webservices for version 1.1 and another for 1.1 later, it makes it very difficult.

I split out all of the webservice projects into separate solutions and rebuilt all of the web references and made sure everything targeted .Net 2.0. So now we can build and deploy them separately. This makes it really clear what is being released in each GoldMail Release.

The next thing was our conversion service, which takes the GoldMail assets that are uploaded by our desktop product (the Composer) and turns them into a playable GoldMail. This is a Windows Service, and we had not modified it in well over a year. The one that we have in production works, but once in a great while it has a problem unzipping the files.

The first step for this was to get it to build as a .Net 2.0 project, and figure out how to deploy it. It had a lot of moving parts, and was extremely complicated.

After I finished, we built everything and put it on staging and gave it a good drubbing, and then moved it to production. This gave us a baseline to work with. I was very excited about this, because it was a huge release, and nobody noticed it. This means that it worked.

Our next release, currently scheduled for the end of this month, is what we call our “Facebook release”. I don’t want to give specifics, but I will say we’ve made things more elegant for our customers who post GoldMails on Facebook. This release required updates to the conversion service. Did I mention the code was incredibly overcomplicated? Updating it seemed like adding more gargoyles to the Notre Dame Cathedral, so I decided to rewrite it.

It took me 2 days. I removed all of the unneeded code (someone was planning for expansion that never happened), and added a substantial amount of logging, including showing the GoldMail ID in each logged entry so you can easily track the progress of a GoldMail conversion. I added the features we needed for Facebook, added double-checking on the files after they were unzipped, and addressed a couple of other bugs as well. And I added a whole lot of comments. (Someone I used to work with would sneer and say, “She puts comments in the code”, as if that’s a bad thing.)

I think the “files missing after unzip” problem was caused because the old program unzipped the files, then set the zip archive to null and called the Garbage Collector. I think it basically removed it before the files were flushed to disk. The only time you really should ever need to call the Garbage Collector is if you are using something that is unmanaged, like GDI+ or audio or something like that.

I reduced the code base from over 5,000 lines of code to about 600. From 20+ classes to 3. Yes, you read that right. AND I added logging and comments. I reduced the complexity of the build and reworked the process to remove a CLR trigger from our database.

CLR triggers are very cool, but that’s not a good reason to use them. This is a trigger you can write in C# or VB and have SQLServer run; they are not performant, and you should pretty much only use them if they are your only choice. I removed this trigger and backed the business logic up into the prior step.

The conversion service rewrite, along with all of the other backend changes we needed for the Facebook release, have kept me very busy. After working 18 hours on Monday and 12 on Tuesday, I’m happy to report all of the backend and client application work items have been completed, and we deployed it all to staging for QA to test today (Wednesday). It is currently scheduled to be released some time before the end of July.

So what comes next? I’m going to structure the backend to handle what I call “Replace-A-GoldMail”, and then wait for the Product Manager to figure out how best to take advantage of it. I think it would be awesome if you could replace the content of a GoldMail and not have to change the URL. For example, you could do monthly status GoldMails and embed it, and it would play the newest one.

Things are calmer at work now that I have a baseline on the backend that is pretty clean, and I’ll be able to stop working weekends again (I’m making no promises about the length of my days though!) I have some great ideas for articles for my blog.

How to deploy a SQLServer (Express or CE) database, and handle updates? How to add files to your deployment? How to deploy 3rd party dll’s without pushing them as prerequisites? How to deploy SQLCE without pushing it as a prerequisite? How to deploy to localhost to test your deployment? These are questions I see over and over again in the MSDN ClickOnce forum.

Other ideas: How to create an Outlook 2007 Add-In that customizes the Office Ribbon and deploy it using ClickOnce? (I wrote one for GoldMail on my own time, just for fun — it’s very cute.) How to write a windows service and have it run multiple tasks simultaneously and asynchronously using a thread pool and callbacks? How to install the same windows service? How to add and remove items from an MSMQ? How to run an MSMQ on your own machine?

I also have an idea about writing a PowerPoint Add-In for GoldMail. My friend Beth Massi, who works at MSFT, grins every time I mention that. Apparently PowerPoint is the least-documented object model in Microsoft Office. Heck, why start with something easy?

(Note: If you’re working on VSTO applications, check out the new VSTO book by Eric Carter and Eric Lippert. It’s awesome, and covers a LOT of information.)

So that’s what’s coming up. I’m looking forward to it, and hope you are too.

2 Responses to “Incommunicado”

  1. John Dempsey Says:

    Currently re-writing the manual deployment walkthrough and reading intently from Microsoft! Good luck!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: