“Brokered definition set” design pattern — well-known under another name?

后端 未结 6 1701
执念已碎
执念已碎 2021-01-06 11:58

In a project that I\'ve been involved with for many years, I\'ve gradually evolved a design pattern that\'s proven to be extremely useful for me. I sometimes feel I should

6条回答
  •  天命终不由人
    2021-01-06 12:36

    What you have is a map, aka Dictionary. You just have a unique twist on it by having multiple keys map to one object.

    Why its a map:

    • keep a key
    • Use the key to query a value from some data structure.

    You can find implementations in:

    • STL (include: map)
    • Java (import: java.util.Dictionary)

提交回复
热议问题