The fourth one is I: Interface Segregation Principle (ISP)
This principle states that interfaces should only contain the absolutely required properties/methods needed.
If an interface contains properties/methods the client code does not need, it should be split into more smaller interfaces.
The third one is L: Liskov’s Substitution Principle (LSP)
This principle states that if S is a subtype of T, then objects of type T may be replaced with objects of type S without altering the desirable properties of the program (includes correctness, task performed, etc.)
As a developer you probably know the DRY abbreviation already: Dont Repeat Yourself.
This is one of the better known principles, and it’s fairly easy to comprehend too: Don’t implement the same logic twice.
However one place where most people slip with DRY, is the switch statement.
The second one is O: Open/Closed Principle (OCP)
This principle states that classes should be open to extension, but closed to modification.
The first one is S: Single Responsibility Principle (SRP)
This principle states that a class should only one have responsibility, which is usually interpreted as having a single “reason to change”.
I recently had an issue with a website timing out a ton of stored procedures because of deadlocks.
Looking back in the error log, I could see it all began when it failed inside the given SP with an arithmetic overflow.
This would normally be no big deal – however this time, it occurred inside an explicit transaction…
When using multiple threads in an application, you often want to be able to signal threads, to ensure a high level of responsiveness.
There are multiple ways to do this, but here’s what I feel is the best solution.
I often come across some good articles, so I decided to start sharing them.
This time I’ve got a great article about ASP.Net Webforms Viewstate, and a thorough article about dot.net 4.0 Code Contracts.
Most databases will eventually make use of stored procedures.
However out-of-the-box there’s no “execute SP” role to assign your SQL user.
Here’s how to create the role and grant it the proper access.
Visual Studio can lose intellisense support in HTML view for ASP.Net sites.
Here’s how to recover it.