Questioning the Use of Google Protocol Buffers

August 28th, 2009

GottaWonder.jpg

Being new at a job means trying to fit in. At least it does for me. After you've been around and seen how things are done, and why they were done that way, you can start to critique what's going on. Short of that, you're a clear outsider looking in, and your statements are written off as "...well... if you really understood how we do things here..." and dismissed. So I've been trying to understand the usage of 29West as the messaging system and Google Protocol Buffers on top of that.

I can see the many advantages of Google Protocol Buffers:

  • Language independence
  • Transmission protocol independence
  • Automatic class code generation

But if you look at these classes, they are really very thinly wrapped objects with simple setters and getters and no real place to put higher-level methods on top of the data package.

I can also see that any good messaging system has the exact same capabilities. 29West is no exception, and in it's API you can package up elemental datatypes, shoot them out, and pull them out at the receiving end in an entirely different language.

Sure, 29West is a single transmission protocol, but that's the point of settling on a standard messaging platform for the organization: you want to have one, and only one, messaging system you have to deal with. Given that you make this selection, it seems like overkill to use Google Protocol Buffers to package up the data into a generic byte stream 'payload' in a 29West message.

I suppose if 29West had adopted this, or Google Protocol Buffers had a 29West 'wrapper', it might make sense, but neither does exist. It's just payload packaging on top of a system that already handles the problem of payload packaging quite well.

And as I'm thinking this I read in their C++ tutorial:

Protocol Buffers and O-O Design Protocol buffer classes are basically dumb data holders (like structs in C++); they don't make good first class citizens in an object model. If you want to add richer behaviour to a generated class, the best way to do this is to wrap the generated protocol buffer class in an application-specific class. Wrapping protocol buffers is also a good idea if you don't have control over the design of the .proto file (if, say, you're reusing one from another project). In that case, you can use the wrapper class to craft an interface better suited to the unique environment of your application: hiding some data and methods, exposing convenience functions, etc. You should never add behaviour to the generated classes by inheriting from them. This will break internal mechanisms and is not good object-oriented practice anyway.

They echoed the exact thoughts I was thinking at the time. This is a "data encapsulation" system for transmission on multiple protocols. It's not advisable to subclass these guys because the generated code could get changed at any time and break your code -- so it's really just a data 'packager'. Which is nice, if you need it. But why do you need it if you have a messaging system that does this already?

Answer: You don't.

In the applications I'm looking at, it's clear overkill. There's no added functionality, and just added overhead. If there were the chance that we'd need to use a different transport in the future, then that would be something. If we were abstracting away the 29West messaging so that it could be changed out easily, that would be something. But we're not.

I can see this as something that someone wanted to do - no real need - just a want. That's a pretty thin reason to make organizational standards.

Who knows... maybe there's a reason for it that completely evades me at the time. But I don't think so. I think Google said it best:

...they don't make good first class citizens in an object model.

and if that's the case, and you've already standardized on a messaging system that does this same packaging, why would you choose to use them?

Sparkle as Moved to GitHub – Nice Affirmation of Git

August 28th, 2009

gitLogo.gif

Well, I'm happy to read that Sparkle, that amazing updater for Mac OS X, is now being hosted at GitHub. While it doesn't mean all that much to many, I do believe that the choice for me of Mercurial or Git has ended up being right.

There are just too many things about Git that are nicer than Mercurial.

But hearing serious developers came to the same conclusion is also reassuring.

Dropbox is Not Snow Leopard Ready

August 28th, 2009

Another of those apps that's important to me - Dropbox, isn't ready. There's a beta, and it looks to be almost there, but it's one that's in the "not" column, for sure. I'll just have to wait a little while before moving to Snow Leopard.

Growl 1.1.6 is Not Snow Leopard Ready

August 28th, 2009

growlicon.png

Well... I see the first reason not to update to Snow Leopard this weekend - Growl is not ready, and from the messages I've been reading from the authors suggests that they won't even start discussing it - or committing code to the repository until Snow Leopard ships. Their concern, and I understand it, is their NDA with Apple, and not getting sued.

But if that's the case, can't they have one box that had the Snow Leopard code working? I can't believe they have the Snow Leopard betas (hence the NDA) and aren't at least trying to get their code working. Sure, they can't release it, but they can get it ready on a branch - waiting just for today when it's released, they can check it all in, and it's ready to go.

In any case, this is going to have to wait. Crud.

UPDATE: The latest word is that they are looking to have Growl 1.2 out today. They aren't sure if they'll make it, but that's what they are shooting for. If they get it, I'll be very pleased.

Skitch 1.0b8.3 is Out – Snow Leopard Compatibility

August 28th, 2009

Skitch is one of those applications that I simply can't imagine not having, and so I was very happy this morning to see it was updated to provide Snow Leopard compatibility. I don't need any fancy new features - I just need to know it'll work with the new OS.

DrawIt 3.8.5 is Out

August 28th, 2009

DrawIt.jpg

With all the updates for Snow Leopard, I was going through all the significant apps I have and thankfully, DrawIt 3.8.5 is out with updates and, I assume, Snow Leopard compatibility fixes.

  • Significantly improves text display but only when there are no filters applied to the text
  • Compatibility fixes with the upcoming Sketch application
  • Other minor bug fixes

It's going to be a busy day of updating as it's on sale and that means the NDAs are dead and things are starting to flow. Sweet.

Shimo v. 2.2.1 is Out – With Snow Leopard Support

August 28th, 2009

Shimo.jpg

I was going through a Snow Leopard compatibility list this morning and noticed that Shimo 2.1.1/389 - the nice front-end to Cisco VPN is not Snow Leopard ready. So I fired it up to check the version. When I did, I saw that they have an update: v. 2.2.1 which is compatible with Snow Leopard.

Whew! That was close. I want to upgrade to Snow Leopard, but there are some things I can't live without. I'm going to make a list and check them off as we go. It's getting close - today's the day.

Camino 1.6.9 is Out

August 28th, 2009

Camino.jpg

Once again, a round of security and stability fixes for a browser - in this case, it's Camino 1.6.9. The release notes state that in the update:

Camino gets a Mozilla Gecko 1.8.1.23 update, which includes critical security and
stability fixes and also improves Flash and ad blocking features.

so there's really more than a simple round of security fixes. That's nice.

OmniGraphSketcher v1.0.1 is Out

August 28th, 2009

OmniGraphSketcher.jpg

Again another update on the eve of the release of Snow Leopard, OmniGraphSketcher v1.0.1 is out with Snow Leopard compatibility, among it's list of notable changes:

  • Fully compatible with Mac OS X 10.6 Snow Leopard.
  • You can now import data that has text labels specified for only some of the rows.
  • Axis title styles are now saved separately in Save Current Styles as Default.
  • Added a "Select All Fills" menu item.
  • Fixed a bug where dragging a single point from a grouped data series could cause the point to get stuck to nearby points.
  • Fixed several bugs where Undo had to be invoked more than once to revert a change.
  • Fixed a bug where pasting data with the first column all zeroes sometimes caused a crash.
  • Smaller fixes and improvements.

and while the big news this week is indeed the sale of Snow Leopard, it's nice to see the updates for Snow Leopard trickle in so that the upgrade is as seamless as possible.

A Very Uninteresting Day

August 27th, 2009

Everyone has them - those days when you really don't get excited about a lot, but you have to get up, get ready, go to work, do your best, etc. It's just a day, and today was one of those days for me.

Sure, I learned that I really needed to be careful about the centering of divs in the page - more application of the CSS margin-left: auto; margin-right: auto; style, and I also fixed up a co-worker's code who was out of the office today, but that was just a simple thing.

I added a nice database-driven configuration variable to an app that originally had manual configuration. Nothing amazing, but the data was in the database, and the SQL query wasn't that hard to find all futures within a group that had no options on them, and then I'll never have to hassle with the manual configuration again. Nice, but not amazing.

I did the work. Nothing fancy. Just one of those days.