Feeds:
Posts
Comments

Archive for the ‘Back to basics – C#’ Category

Another back to basics post for reference material . I will follow this post with how to improve this basic pattern with .NET 4 objects. In building a real time news aggregator which requires a producer – consumer queue to provide up to the second news feeds for a trading engine, I have updated my [...]

Read Full Post »

I came across the Interlocked class today. It is a very simple way of incrementing or decrementing or doing thread safe algorithmic calculations based upon a single property change in the same class. It is no good for changing the properties of another class, such as an element on a domain object, but is quite [...]

Read Full Post »

UML has been around for a long time, but I don’t often use it in my projects. I find the whole subject of UML extremely dry. However, it is great for quickly sketching a design together for conversations as part of the Agile design process. It is a common language tool which the basics should [...]

Read Full Post »

C# Custom Exception handling There has been some discussion about whether or not to use custom exception handling at all, but call me old fashioned, I like to use custom exception as it better encapsulates known / expected problems, especially when writing service orientated architecture and you want to pass exceptions to the calling code. [...]

Read Full Post »

This is just a quick post to cover some of the schoolboy tasks when creating a Windows Service in C#. To create a windows service: Choose the project Windows Service Write code in OnStart and OnStop methods as appropriate In the InitializeComponent method, add the name of the service as it will appear in the [...]

Read Full Post »

Whilst developing applications and especially while unit testing it is often required to test whether an object t is equal to some other object of the same type. It is almost always a value type comparison that is required. This means we need to check to see if the fields on the objects match and [...]

Read Full Post »

Lets say we have some very simple objects such as these two classes: [Serializable] public class ClassA {  public string StrA { get; set; }  public ClassB B { get; set; }  public ClassA Clone()  {  return (ClassA)MemberwiseClone();  } } and [Serializable] public class ClassB {  public string StrB { get; set; } } There are three types of copying objects. These are [...]

Read Full Post »

Follow

Get every new post delivered to your Inbox.