views:

45

answers:

2

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).

A: 

What about always including the adjective: "dispatch key", "database table key" Or renaming based on usage: "dispatch criteria"

atk
A: 

You can try to find a good metaphor and try to stick to it, if possible not related to software programming to avoid confusion.

  • Say we are in a police story and your keys become an informer (or a fink, a squealer, a dealer, ...)

  • If you prefer a driving metaphor your dispatch keys become some roadsign, etc.

Just find one metaphor that fit for you.

kriss