Keys and terminology
Posted
by nabbed
on Stack Overflow
See other posts from Stack Overflow
or by nabbed
Published on 2009-09-23T20:32:21Z
Indexed on
2010/05/03
4:08 UTC
Read the original article
Hit count: 456
I have a predicament related to terminology.
Our system processes events. Events are dispatched to a node based on the value of some field (or set of fields). We call this set of fields the key. We call the value of that set of fields the key value.
What adds confusion is that each event is essentially a bag of key-value pairs (i.e., a hash map). So the word key is used for two different purposes: 1) to describe the set of fields on which the event is dispatched, and 2) as a field name.
So if you had a collection of key-value pairs, and a set of those key-value pairs made up a database-style key, what terminology would you use to distinguish those two?
(One further complication is that the key on which the event is dispatched is not always unique. For instance, if we dispatch on userid, and that user performs multiple actions, we will process multiple events with the same userid value. So maybe key is the wrong word to describe the set of fields on which we dispatch an event).
© Stack Overflow or respective owner