企业库实现AOP的几种方法

1.创建新对象时,分继承基类和继承接口

TargetClass theTarget = PolicyInjection.Create<TargetClass>(parameter1, parameter2);
ITargetInterface theTarget = PolicyInjection.Create<TargetClass, ITargetInterface>(parameter1, parameter2);

2.对已创建对象进行AOP

TargetObject theTarget = PolicyInjection.Wrap<TargetObjectType>(existingObject);
ITargetInterface theTarget = PolicyInjection.Wrap<ITargetInterface>(existingObject);

 

posted on 2017-03-23 16:48  空明流光  阅读(264)  评论(0编辑  收藏  举报

导航