Happyr / message-serializer

Serialize messages for transport over the wire
MIT License
77 stars 12 forks source link

Name ‘identifier’ is somewhat confusing #42

Open ddeboer opened 4 years ago

ddeboer commented 4 years ago

First of all, thanks for this package! It’s a good step towards versioning and interoperability of messages.

While this may be somewhat subjective, I find the name identifier a bit confusing. Identifier suggests a unique id for an individual message. Think of the response you get from AWS when you publish a message:

{
    "MessageId": "e0733b15-fae4-596e-bf81-6c3c271aed0c"
}

I think what you meant is not the identifier but the type of the message: as in a typing system, each (product) type is the combination of properties; in this case the keys in the message payload.

What about renaming identifier to type? Of course, this would be a BC break.

Nyholm commented 3 years ago

Hm.. Interesting.

Just because it is an "identifier", it does not mean it is a "unique identifier". Im on the fence. You are correct that "type" os more clear. But is it worth the BC break?