The code base I am working on contains a huge if block. By huge I mean 77 if statements one after the other, each if checks to see what page id you are on and loads different content. This is not easy to maintain and I want to refactor it. One option would be to replace the if statements with a switch block. However...
A while back I blogged about learning about interfaces as I didn’t really understand the value of them. I do now. I created an application that used interfaces so I could learn how it worked. I created a Logger Interface and created multiple classes that implemented that interface so I could swap out the different...
I am trying to understand interfaces and when to use them in my code. An interface defines a contract and any class that implements that interface agrees to fulfil that contract. Lets look at an example as this tends to be how I learn best. Most applications require some sort of data to work from so lets start by...