Thursday, May 20, 2010

A little fun with The Preference Recorder

Here's a clever little trick you can use with the Preference Recorder in the Workspace Mechanic for Eclipse:

Let's say you built a Preference Task that you want to apply to your workspace. So you put the .epf file in one of the registered directories.

Turn on the Preference Recorder. Let the Workspace Mechanic scan for, and run tasks. It should find your new .epf and offer to apply it, and any other tasks that fail the evaluation phase. After the repair phase completes, turn off the Preference Recorder and see what changes were actually applied.

Kind of fun. If you find that kind of thing fun.

Monday, May 17, 2010

The Preference Recorder

Earlier in the week we announced the release of the Workspace Mechanic for Eclipse on the Google Open Source Blog. This is a tool we have used inside Google for a couple of years, and with a bit of rewriting, made most of it available via open source. (We'd like to get the last piece of it out there, if more than anything, as an idea of what you can do with the Workspace Mechanic for Eclipse.) But this blog post isn't really about what we haven't released, it's about what we wrote specifically for the public release: the Preference Recorder.

This is a nice feature, and I don't want to underscore its usefulness. It'll probably help to think of it like an office suite's macro recorder -- turn it on, it listens to what you do, turn it off, and it builds a nice macro that recreates your steps. Same thing with the Preference Re: turn it on, it listens to preference changes. Turn it off, and it builds a nice file that recreates your steps!

One of the most common uses of the Workspace Mechanic for Eclipse is to propagate preference changes among workspaces.  Do parts of this sequence of events sound familiar?
  1. File > Export > Preferences
  2. Save to /tmp/first
  3. Window > Preferences
  4. Change preferences
  5. File > Export > Preferences
  6. Save them to /tmp/second
  7. $ diff /tmp/first /tmp/second > /tmp/delta.epf
  8. Tweak /tmp/delta.epf until it looks like you want. This includes adding preference metadata to match the format required for preference tasks.
What a pain!

So we wrote the Preference Recorder. It's much simpler!
  1. Right-click the Workspace Mechanic trim widget
  2. Preference Recorder > Start Recording
  3. Window > Preferences
  4. Change preferences
  5. Preference Recorder > Stop Recording
  6. Use dialog to select which preferences you actually want to export.

It'll spit the file out in a way that is compatible with the Workspace Mechanic, but heck, even if you don't want to use it to write tasks, it's a nice way to track your changes.

Friday, May 14, 2010

Update: Workspace Mechanic now has an update site

Sorry for not getting this done earlier today, but now the Workspace Mechanic for Eclipse now has an update site

Also I renamed the mailing list from to -- yes the hyphen has been removed.

Thursday, May 13, 2010

Announcing the Workspace Mechanic for Eclipse

If you saw the slides from my talk at EclipseCon back in March you may recall that we discussed a tool we had built for propagating preference changes across workspaces. Today, I'm happy to announce that the tool, now dubbed the Workspace Mechanic for Eclipse, has been released as open source. And, yes, it's EPL 1.0!

The Workspace Mechanic can be used in both single-user and enterprise modes to take on automating maintenance of all your Eclipse environments. Check out the project overview for details.

One of the coolest things we've added specifically for the public release is a Preference Recorder which listens to changes to preferences, and then saves them as tasks you can apply to all the other workspaces on your machine. Or, the planet. Why not?

The Workspace Mechanic has been tested on Linux and has been sanity tested on OSX. I'd love some feedback on Windows-compatibility issues, because I don't have a Windows machine to test on anymore.

Anyway, I just spent about 13 hours getting the final touches on the repository: fixing wiki content, fighting Mercurial, and finding an unpleasant bug (!) related to different versions of the JDK. (Isn't that supposed to not happen?). Drafting this post is like the last thing on my list, and I'm just all out of skill and energy, and a DVD box set just arrived, so how about I point you to the Google Open Source blog post, and I’ll go watch TV.

Please enjoy.

Monday, May 03, 2010

Apprenticeship Patterns is now Creative Commons Licensed

Apprenticeship Patterns has been open-sourced under a Creative Commons license, according to Ade Oshineye, one of the book's two authors.

Apprenticeship Patterns cataloges dozens of behavior patterns to help you perfect essential aspects of your craft. Compiled from years of research, many interviews, and feedback from O'Reilly's online forum, these patterns address difficult situations that programmers, administrators, and DBAs face every day.  [ref]
As is typical with patterns books, much of the information will have an "I already knew that" feel about it, but it's pattern books aren't about learning new information, they're about unlocking information already in your mind. In this particular case, Apprenticeship Patterns is written as a useful text for new engineers. This comes from the Goals section:
We have written this book in order to share solutions to the dilemmas that are often faced by inexperienced software developers. We’re not referring to technical dilemmas; you’re not going to find any Java design patterns or Ruby on Rails recipes in this book. Rather, the dilemmas that we focus on are more personal, concerning your motivation and morale. This book should help you through the tough decisions that you face as a newcomer to the field of professional software development.
I had the honor of reviewing this book and providing feedback to the authors prior to its publication. So, I think their goals are a bit misleading. I'm a very experienced engineer, and I repeatedly found ideas and inspiration from it. It's not a very long book, it's easy to read, and I think it's ideal for professional reflection. I've recommended this book to several people, and those that have read it have had very positive experiences.

So, as I said, the book is now available in an open source format. As Ade wrote in his announcement:
Just like we were one of the first O'Reilly books to experiment with using a wiki to get early feedback during the writing process we're also one of the first O'Reilly books to experiment with publishing our material under a Creative Commons license. Starting from today the book is now available here:
How exciting! Now this book will become the next one I review in a reading group.

Addendum: Speaking of reading groups, one reading group has been videorecording its Apprenticeship Patterns sessions. Here's Episode 1, and a Search for further episodes.

Attribution: I lazily stole the title of this post from Ade's announcement.