Programming several conditions in C#

Programming several conditions in C#

When you have to programme a piece of code which have several conditions you could do it in the following way: switch(a.name){    case “smith”:        CallHim();         break;    case “doyle”:        SendAMessageToHim();        break;    default:        throw new WriteNotReachableErrorException();} If you couldn’t use constants as conditions, you will implement the logic in the following way: if(a.name == smithObject.ToString()){    CallHim();}else if(a.name == doyleObject.ToString()){    SendAMessageToHim();}else{    throw new WriteNotReachableErrorException();} But if you think now there is now other possibility to implement the logic, wait! I found recently…

Read More Read More

Object oriented programming (Part 1)

Object oriented programming (Part 1)

Jonas showed me an interesting link on infoq. Unfortunately, video shows not the hole presentation, but the things which you could learn are very essential for object oriented programming. I decided, that I want to blog more about that. One of the main principles is the open-close-principle by Bertrand Meyer. But more about that and the others principles in a later post.

First assumption

First assumption

Well, it’s sunday, the sun is shining and right now I am watching the newest epsiode of dnrTV! (it’s about design patterns). Now, what I want to be is a better software developer and software architect and I would like to see my progress in learning (and my knowledge in english). One way is watching videocasts or listening to podcasts. Another way is writing down the things I learned. Well the first thing is already “implemented”, so I tackle the…

Read More Read More