Which design pattern would you consider when Logging is needed?

后端 未结 5 1923
悲哀的现实
悲哀的现实 2021-02-02 00:11

An application I\'m working on requires logging of actions, user who performs the action, and time of action to a database.

Which design pattern is most popular/appropri

5条回答
  •  清歌不尽
    2021-02-02 00:55

    I agree, I think the command pattern would fit the most since you would have all the action listed.

    But I don't think that you really need to follow a design specific pattern for this one.You can simply set a callback on the actions to update the log. It depends on your architecture and technologies but out of my head the command pattern sounds like overkill.

提交回复
热议问题