问题描述
我正在寻找关于如何实现审计跟踪我在C#中的对象的想法,对于当前的项目,基本上我需要:
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的旧值和给定对象的新值。
2.Record创建新对象。旧目标
3.Deletion。
1.Store the old values and new values of a given object.2.Record creation of new objects.3.Deletion of old object.
是否有这样做,喜欢用C#泛型,这样我就不用写代码的任何通用的方法像在创建基本对象的事件,对缺失等(ORM对象).The的事情是,如果有如果使用的是.Anybody有任何经验或他们follow.Any方式的任何方法注入审计线索的方式为此在一个面向方面(AOP)mannner。
Is there any generic way of doing this,like using C# Generics,so that I don't have to write code for events of the base object like on creation,on deletion etc.(ORM objects).The thing is that if there was a way to inject audit trail if one is using a .Anybody have any experiences or any methods they follow.Any way to do this in a Aspect-oriented (AOP) mannner.
请分享您的想法等。
推荐答案
的问题是相当类似
的
我们已经实施了类似的解决方案,使用AOP(AspectJ实现)。使用这种特殊的点可以被捕获并可以进行特定的操作。
We've implemented a similar solution, using AOP (aspectJ implementation). Using this particular points can be captured and specific operations can be performed.
这可以插上电源,插上了我们喜欢的。
This can be plugged in and plugged off when we like.
然而,我们的实现是J2EE ..
However, our implementation was in J2EE..
如果你真的想这样做在应用层,我建议这一点。
If you really want to do it in the app layer, i would suggest this.
希望它可以帮助..
这篇关于实施审计跟踪在C#中的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!