Serialize.Linq, Data Transfer Objects and Business Objects

In a well designed n-tier application, you use your data transfer objects (DTO) to communicate between your server and your clients. A DTO does not have any behavior except for storage and retrieval of its own data, so normally you have logic to map between your data transfer objects and business objects or data access objects.


Serialize LINQ Expressions in Everyday Situations

This is the second article about my new library Serialize.Linq. Today I want to focus on the serialization of LINQ expression outside the whole WCF context.

Think about a situation where you provide a customizable search for your users and you want your users to be able to store their custom queries.


Serialize LINQ Expressions over WCF

I like LINQ expression - a lot. It makes my life so much easier when querying data. But LINQ expressions have (at least) one drawback: they are not serializable. But think about it, wouldn't be awesome to define your expressions on the client side, and get them executed on the server? I thought so, that's why i wrote Serialize.Linq.


Hello and welcome back!

I finally moved my existing blog to here (before I was with wordpress.com, but wasn't happy about it). For those who didn't know my blog before, don't worry and welcome. For those who did know it: welcome back.

The last 2 years have been busy, and i didn't have time to blog alot, but i promise that will change. I have lots of things planed, some of them are ready to get public soon. So stay tuned and focused.


Perl-like-Map in C#

If you know a little bit of Perl, you probably know the <map> function (perldoc -f map).

Map takes an expression E and a list L, transforms the elements of L using the expression E and returns a new list with the transformed items. A short example:

    my @words = ('foo', 'bar', 'perl', 'is', 'cool');
    my @firsts = map { substr($_, 0, 1) } @words;

The above code takes <@words> and transforms its elements into a list containing only the first letter of each word in @words. (At all perl monks ou there: i know that there are more simple ways to achieve that :-) ). Anyway, i tried to achieve the above functionalty in C#. It kinda works by using extensions on <IEnumerable>:


JSONBuilder in C#

Small JSON Builder (no garanty it will work for every object):


Simulate a Click

Small snippet to kinda simulate a click on a control

    static public class ControlExtensions
    {
            static public void SimulateClick(this Control control)
            {
                if (control != null)
                {
                    MethodInfo method = typeof(Control).GetMethod(&quot;OnClick&quot;, BindingFlags.NonPublic | BindingFlags.Instance);
                    if (method != null)
                        method.Invoke(control, new object[] { EventArgs.Empty });                
                }
            }
    }

Does the job for me - so far.


Secure Remote Password protocol (SRP)

The Secure Remote Password Protocol (SRP) is a password-authenticated key agreement protocol. Before, I used digest algorithm (similar to Digest access authentication) to authenticate my users. As I had to add encryption to my message system (not 100% encrytion means only some messages are confidential) I decided to implement SRP.


Implementing IAsyncResult aka NamedPipeClientStream.BeginConnect

Anybody who is working with asynchronously called methods has probably used IAsyncResult. Well, nobody is really using it, instead you are used to get it as a return-value of some BeginX function and put it back in the corresponding EndX function. ... For my current project, i'm using NamedPipeClientStream to connect to a named pipe server (obviously!). I noticed that it does not support asynchronous connection. As my whole projekt is building on asnychronous techniques, I started to implement it.


WeakReference

.NET has no gerneric implementation of WeakReference. So here it is.


Later Earlier