How many times have you just thrown something together, put it in the wild, expecting to never hear from it again and then five years later you get an email with this in it. Oh, just me then. In this instance it was a fix for Excel 2010 and I thought it was not used … More Five year old piece of code suddenly fails.
There are times when you create an assembly executable that has dependencies on other assemblies. You may want pass this assembly around without having the need for it to be installed however; if you have to copy DLL’s around with the EXE, there could be a chance that they are forgotten or the wrong versions … More Embedding .NET Assemblies inside .NET Assemblies
The TRY/CATCH/FINALLY exception handling has been around since C# 1.0 and you are very unlikely to find a developer who does not know how to use them. What may not be so obvious is that there are a number of hidden gems that few developers use. This is on top of new enhancements that have … More C# Exceptions – Hidden Gems
Principle Classes that depend on other classes should depend on abstractions rather than concrete implementations. This makes the classes much more flexible to changing implementations. Scenario To demonstrate ISP I will continue using the E-Commerce example from the previous blog. A customer has an order which includes multiple order items. Given an order we calculate … More SOLID Principles – Part 06 – Dependency Inversion Principle
Principle Functionality should be broken into specific interfaces rather than one all-purpose interface. This means clients are not be forced to depend upon methods that they do not use. Scenario To demonstrate ISP I will continue using the E-Commerce example from the previous blog. A customer has an order which includes multiple order items. Given … More SOLID Principles – Part 05 – Interface Segregation Principle
Principle This principle is an extension of the Open Close Principle and was first introduced by Barbara Liskov during a conference keynote speech. We need to ensure that new derived classes are extending the base classes without changing their behaviour. You should be able to replace a class with its base type without altering the … More SOLID Principles – Part 04 – Liskov Substitution Principle
Principle A class, properties and methods should be open for extension but closed for modification. E.g. If we need to add new functionality to a class, it should be added using a derived class. Scenario To demonstrate OCP I will continue using the E-Commerce example from the previous blog. A customer has an order which … More SOLID Principles – Part 03 – Open Closed Principle