Is this the best approach to creating an audit trail?

后端 未结 6 467
滥情空心
滥情空心 2021-01-01 06:05

I\'m trying to create some functionality that keeps an audit trail of how data in a given user form has been changed over time, with a dated audit at the foot of that page.

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

    I think your proposal would involve writing a lot of code/metadata to enable comparison of objects/records so you get a business-level audit.

    Alternatively, a database trigger may not give you a high-enough level view of what happened. This may be acceptable if you use the audit so infrequently that the effort of recreating the business meaning is ok.

    This also seems like a good application for AOP (Aspects), where you could use reflection on the object model to dump something meaningful without requiring a lot of metadata.

提交回复
热议问题