Implementing Audit Trail for Objects in C#?

前端 未结 5 2135
感动是毒
感动是毒 2020-12-29 15:02

I\'m looking for ideas on how to implement audit trails for my objects in C#, for the current project,basically I need to:

1.Store the old values and new values of a

5条回答
  •  被撕碎了的回忆
    2020-12-29 15:13

    In addition to some of the things mentioned in the above thread the Command Pattern might be of help, if you wrap all the state changes on your object in a command then the command can be responsible for keeping the audit trail, while the object does not have to worry about auditing itself. Of course there is added overhead to creating and disposing commands.

    You can wrap commands around any existing object structure, you just delegate your actions to the command layer as opposed to doing them on the objects directly.

提交回复
热议问题