This might be a silly question, but I have never found a satisfying way to name a variable of type HashMap
in Java. For example - lets say I have a
I found a great case for countiesByState
here:
valuesByKeys
, as in teamsByCaptains. If you're going to include both key and value, this seems to read best. At a high level, you can read it as just "teams", so anything that's performed on it is being performed on teams. The "byCaptains" prefix reads as it should do: a less significant qualifier that follows the teams around to help someone understand the structure if they need to.
This also allows you to access a value in a JSP with the nice notation countiesByState[myState]
.