software development

Merging Hierarchical Paths in Java

I’ve been doing heavy refactoring over the last 48 hours to cope with epic VMware fail. One part of that has been the necessity to do something pretty tricky, and as it turns out, Apache Commons has a massive shortcut I thought I’d share with the rest of you. Imagine there are multiple tree branch paths and let KX equal the terminating value:

A.B.C.D.K1
A.B.K2
D.K3

I needed to merge these paths so that I ended up with one hierarchy:

A
|
|--B
    |-- K2
    |
    |--C
        |
        |--D
            |--K1
            |--K3

I knew how to do this merge with linear performance, but I was trying to come up with a solution that was more optimal. It turns out Apache already has one, and it’s called Hierarchical Configuration. Basically you just do the following:

import org.apache.commons.configuration.HierarchicalConfiguration;

HierarchicalConfiguration hc = new HierarchicalConfiguration();
hc.addProperty(“A.B.C.D”, “K1”);
hc.addProperty(“A.B”, “K2”);
hc.addProperty(“D”, “K3”);

The object will create new branches if the paths do not yet exist, but if they do, the values will simply be inserted into the appropriate location. This has been a massive timesaver and hopefully you all will find it useful as well.

Advertisements
software development

Preventing Same Version Downgrades with WiX

So I farked up when I was building several MSI packages using the Microsoft Windows XML (WiX) Toolset. I broke a sacred covenant of MSI development and violated the component rules.

This would not normally be a huge concern since the members of the components, the files, are not going to change. However, I did run into an interesting issue. Because my company’s versioning scheme is MAJOR.MINOR.REVISION.BUILD where BUILD is a value auto-incremented by the build server, as far as MSI is concerned 4.0.0.123 is the same version as 4.0.0.187. And because our patch strategy is to simply release a hot-fixed MSI, we have to allow same-version upgrades.

Anyone familiar with MSI upgrades knows the dirty secret that allowing same version upgrades allows same version downgrades. Except these downgrades would result in files disappearing from the filesystem. After much research I determined the issue was because of my stupid decision to group multiple files into single Components. MSI was not applying the standard file versioning rules correctly, and thus during a downgrade the following steps were occurring:

  1. Version X is installed on a system and user attempts to install version X-1.
  2. The installer appears to calculate which Components need to be installed by version and date. It does not include the X-1’s Components because they are already on the system.
  3. The installer removes X’s Components from the file system.
  4. Finally, the installer chooses not to install X-1’s Components because the installer has already calculated that the Components on the filesystem, at version X, were newer.

I found myself in quite a pickle. How do I prevent same version downgrades when the only varying component of the version is the 4th component (which again, MSI ignores)?

Continue reading

software development

I Love Balsamiq Mockups

Let me just say right off the bat, that I hate, hate working on Functional Specifications, and the reason for my loads of loathing is the user interface (UI). Managers want specifications to include screenshots of the UI, but as I’ve tried to explain, it is a chicken-and-the-egg situation. Do you want a specification, or do you want me to work on the UI?

The answer to this problem is usually creating wireframe mockups of the eventual UI. However, I’ve yet to find a mockup tool that I like. I’ve tried tools like Visio and OmniGraffle which are good tools, but they focus more on diagraming and process flow than wireframe design. Not to mention the aforementioned applications share a particular trait with an almost standard for creating mockups — Axure — complexity. The barrier to entry for these applications for doing something as simple as creating mockups is relatively high. I have longed for something simple, powerful, and straight-forward.

And then I found Balsamiq Mockups.

Continue reading

software development

i18n f4n

When designing EMC VSI 4.0, early on I made a decision that the entire core framework was going to be i18n compatible from the ground up. Unfortunately this led to colorful weekend. While this topic has been discussed time and time again, it’s so important that it bears repeating: just because your copy of Windows is set to use a different region’s locale doesn’t mean that you’re not still using good ‘ol en-US when it counts.

Continue reading

software development, storage, virtualization

EMC VSI 4.0

When I agreed to join EMC I was not sure what to expect. I’d worked in academia, a start-up, dabbled in reverse engineering, and contributed many projects to the open source community. However, EMC is unique with respect to all of the positions I’ve previously held or projects I’ve created. Higher education is a lot like open source, there is an implicit freedom — you get to play. A start-up is small and fast, and reverse engineering is all about figuring out how to gleam the rubik’s cube. EMC is the titan, the behemoth, the first IBM-like company that I decided to work for. Would I be consumed, or would I manage to stay relevant even as employee number 123456?

Eight months later, I have my answer. I’m tremendously proud to introduce to the world, in all its gory detail:

EMC VSI Icon

EMC Virtual Storage Integrator (VSI) 4.0 for VMware vSphere

Continue reading