Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the difference between PostSharp and Castle Dynamic Proxy?

Just wondering what the main differences are between these libraries, how they differ in features and functionality.

Hoping for more information than I could find with a Google query...

like image 743
John Farrell Avatar asked Oct 13 '09 01:10

John Farrell


People also ask

What is Castle Dynamic Proxy?

Castle DynamicProxy is a library for generating lightweight . NET proxies on the fly at runtime. Proxy objects allow calls to members of an object to be intercepted without modifying the code of the class. Both classes and interfaces can be proxied, however only virtual members can be intercepted.

What is aspect oriented programming. net?

Aspect Oriented Programming (AOP) allows us to keep the original code as-is, and provides us a way of weaving an aspect (e.g. logging) into the code. An aspect is supposed to be defined in a generic way so that it can be applied to many objects in the application.


2 Answers

The main difference is when the AOP code is incorporated into your program

"Postsharp works by weaving at compile time"

Dynamic Proxy generates lightweight .NET proxies on the fly at runtime.

see: Applying AOP

like image 183
Jon Schoning Avatar answered Sep 28 '22 03:09

Jon Schoning


http://ayende.com/Blog/archive/2007/07/02/7-Approaches-for-AOP-in-.Net.aspx

like image 26
Krzysztof Kozmic Avatar answered Sep 28 '22 04:09

Krzysztof Kozmic