A framework for automatically converting method invocations of any programmatic interface into a single-method normal form and converting back to invocations of the original interface.
For a full explanation of what Intertwine is, what problem it solves, and how it solves it, please read this post on my blog: michael.gr - Intertwine
The following text assumes that you have already read the blog post and that you fully understand it.
The solution contains the following projects:
-
Intertwine - This is the central class library which accomplishes all the magic.
-
InterfaceEvents - Sample class library project which acts as a proof-of-concept and demonstration of Intertwine. It offers multicast events that invoke interfaces instead of delegates.
-
Test - Tests for Intertwine and InterfaceEvents
-
Benchmark - A console application performing a speed comparison between Intertwine, hand-written code that achieves the same thing, Castle Dynamic Proxy with reflecting Untwiner, and LinFu Dynamic Proxy with reflecting Untwiner.
- Make the
Intertwine.Factory
class instantiatable instead of a singleton, get rid of theIsCaching
constant, and makeIsSaving
a parameter. - Add support for a few missing types, such as
Decimal
, or make it handle all value types in a uniform way. - Add support for creating only the entwiner class or only the untwiner class if the other one is never needed.
- Replace
int selector
withMethodKey key
as in the Java implementation. - See if
RegisterObserver
andUnregisterObserver
can be implemented as+=
and-=
operators.
■