Design Patterns

.Net Tips – Use Request and Response objects

We’ve all been there before, write a simple service with a simple method: As time goes by, the simple method gets more complicated, and the list of parameters grows and eventually simple method is overloaded to provide more variety and simple method is simple no more! A simple solution to this is the Request-Response pattern, …

.Net Tips – Use Request and Response objects Read More »

Threading – Producer-Consumer Pattern

Having run into a bit of deadlocking issue while working on Bingo.Net I spent a bit of time reading into the Producer-Consumer pattern and here’s what I learnt which I hope you’ll find useful too. AutoResetEvent and ManualResetEvent To start off, MSDN has an introductory article on how to synchronize a producer and a consumer …

Threading – Producer-Consumer Pattern Read More »

Pattern for dealing with null handler for events in C#

If you’ve used events in C# before, you’ve probably written code like this too: This is perfectly ok and normal to do, but can quickly become tiresome if you have to fire events in multiple places in your code and have to do a null reference check every time! So instead, I have been using …

Pattern for dealing with null handler for events in C# Read More »

Buzzword Buster – IoC

Definition: Inversion of Control (IoC) refers to the inversion of the flow of control (the order in which individual statements, function calls, etc. are executed) in a software. You’ll often hear the term Hollywood principle being mentioned in the same breath as IoC, it simply states "Don’t call us, we’ll call you" which more or …

Buzzword Buster – IoC Read More »

The C# Dispose Pattern

The Dispose pattern is something we’ve all seen before, and it’s so tried and tested most of us (especially myself!) have been more than happy to apply without question. Whilst reading various blogs/articles I came across some differing opinion about this well known pattern and started to question what I had taken for granted myself. …

The C# Dispose Pattern Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close