The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,949 other followers

Aspect Oriented Programming in Delphi

Posted by jpluimers on 2015/06/24

I’ve been doing Aspect Oriented Programming (AOP) in .NET for a long while, mostly using PostSharp LAOS as that was the first AOP .NET library I encountered (5 years ago it became PostSharp 2.0, now it is already at its 10th anniversary!).

AOP allows you to perform separate of concerns (SoC) in your application, especially in the area of cross-cutting concerns like for instance logging, authorization, monitoring, etc.

It took a while in Delphi to allow for AOP, but the TVirtualMethodInterceptor (that introduced in Delphi 2010) can be used to do AOP (only for Virtual Methods, which is still way better than having no AOP at all).

The code requires a lot of manual labor. so I was glad that DSharp (a great library by Stefan Glienke – one of the leading Spring4D contributors) contains a nice wrapper around TVirtualMethodInterceptor so you can use AOP in an attribute based fashion.

Nick Hodges recorded a good introductory video on AOP in Delphi with slides and demo code:

Note that besides DSharp, also MeAOP and Infra provided support for AOP in Delphi, but these haven’t had updates since 2010.


via: AOP on .NET – PostSharp.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: