nathanmarz/storm — Issue #58: Change stream and component IDs to Objects
Author: ashleywbrown
Created: 2011-12-01 10:16:13+00:00
State: open

I think it would be a positive change if stream and component IDs became generic Objects, rather than Strings, allowing any objects which implement .equals and .toString to be used.

Moving from integers to strings for IDs was a step in the right direction, however it is still prone to typos, or patterns such as:

static final String MY_STREAM_NAME = "something";

In our systems we declare enums, analogous to:

public static enum Streams {
MY_FIRST_STREAM,
MY_SECOND_STREAM
}

And can then iterate through those streams to declare outputs. This leads to patterns such as:

.shuffleGrouping(MY_BOLT,Bolt.Streams.MY_FIRST_STREAM.toString())

The .toString could be eliminated, and just the plain enum passed in.