Separating Concerns in DynamicProxies

I just finished adding a small but nice feature to DynamicProxies. Now you can use the ProxyBuilder class to pre-bake proxy classes. The key aspect of this feature is that it allows a client to put all of the proxy classes into one assembly. Before, every time you made a proxy, a new assembly was created (this is just the way it is with dynamic code in System.Reflection.Emit). Now, if you a group of types are going to be proxied, you can do the proxy class generation as an initialization step, and only one dynamic assembly will be created. This may seem like an odd feature, but separating the generation of the proxy types from their instantiations is a much cleaner implementation. To the client, the API looks the same, but now there's more options available, and it's easier for me to maintain and add features in the future.

I've also made some other code and API refactoring. Now the Create() method is an extension method for the object type, so you can now write code like this:

var customer = new Customer().Create(this);

Assuming, of course, that the current object implements IInvocationHandler.

Get the latest code drop and check it out.

* Posted at 09.27.2008 05:28:54 PM (Last Update: 03.31.2009 10:19:03 AM) | 4 comments | Link | RSS *

Comments

# Why, from Nermin at 09.28.2008 02:04:33 PM

My question is - why start a new Open Source project if Castle Project DynamicProxy already does that (and is used across the board by number of other tools - dynamic mocking llibraries IoC containers, etc...):
http://api.castleproject.org/Index.aspx
Check out Castle.DynamicProxy namespace.


# Because :), from Jason Bock at 09.29.2008 03:12:38 PM

Nermin, 1) I've been working on this project for years. It's the basis of Chapter 8 in my CIL programming book, so that makes it at least 6 years old. 2) I started writing it, because, at the time there was nothing else like it (or at least I couldn't find anything else). 3) It's a fun project to keep up-to-date because of the knowledge gleaned from exploration.

# so basically..., from faffy fuck at 03.31.2009 07:45:58 AM

...you're filling up the intarwebz with redundant crap 'coz it makes you feel good? Damn what a unique project.

# Hey fatty, from Jason Bock at 03.31.2009 10:19:01 AM

Next time you want to make a useless comment that clogs the internet with worthless drivel and that shows how ignorant you are, state WHO you are, rather than being a chickenshit anonymous fucktard. Glad I could help!

Add a Comment

(*) = Required field
Name (*):

E-Mail (*):

Web Site:

Title (*):

Comments (*):

Enter the code you see (*)



Quote
"To know that you do not know is the best. To pretend to know when you do not know is disease." Lao Tzu
Twitter History
follow me on Twitter
Blog History