Bogdan Varlamov (a.k.a. Phantom Stranger)

Lambdas, Extension Methods, and Asynchronous Execution Example


by Bogdan Varlamov (a.k.a. Phantom Stranger)

I've often found myself working on a class in some legacy application using objects hidden away in third-party libraries and thinking, "Wow... it would be really great if I could call this current existing method but have it process asynchronously (without blocking) and then notify me when it is complete."

The only way to do this would be to inherit the legacy object and add a new "Async" version of the method, right? And what about those pesky sealed classes? Not to mention the problems with having to refactor your whole application (and perhaps any dependent components used by other applications).

It can be quite a mess! But, luckily there is a simpler way...
Would you like to know more?

So, I've been hoping to make a nice little generic encryption module that essentially just wraps the .Net System stuff.  Why?  'Cause I'd like to move some data around with reasonable security (it doesn't have to be completely hacker-proof, just reasonably obscured -- the data I'm covering isn't worth that much, but it's worth more than zero so it deserves some due process.) This is done with that atitude, if you want hard-core encryption, then your better off not using a wrapper (set your .IV cleverly, don't resize improper-length keys, etc.) Alternatively, use an existing, clean, third party app (or write your own -- R4 is not too terrible to code and is very powerful, especially if you tweak it during the implementation).

Would you like to know more?