AOP support in Delphi

后端 未结 3 513
旧巷少年郎
旧巷少年郎 2020-12-28 19:58

Is it possible to do Aspect Oriented Programming in Delphi? I would be interested in native support as well as third party solutions.

I don\'t have a specific proble

3条回答
  •  没有蜡笔的小新
    2020-12-28 20:23

    The DSharp library features AOP:
    https://bitbucket.org/sglienke/dsharp
    More info can be found at: https://bitbucket.org/sglienke/dsharp

    Also have a look at TVirtualMethodInterceptor.
    It's in the RTL since Delphi 2010 and allows you to do OnBefore, OnAfter, etc. calls on all virtual methods on a class.
    This call alone should cover must of what you need using Rtti, not weaving which is much faster than run-time weaving.

提交回复
热议问题