Venn diagram of developer types

Hey readers, It has been so long since we had a chat [Even one way :-)]. Have been busy with lot of things. But as I have been saying in past, The more busy I’m, the more I got for you to read.  So, le’s come to the point.
It has been roughly a decade since I am privileged to be in Software Development field. During that period, have played different roles. Now, When I look back, I try to analyze lot of things and I came up with my understanding about type of developers. You might ask why I need to know type of developers. Here are my views why:

  1. Hiring : When you are hiring new developers, you need to understand which type of developer is this and which type of developer you are looking for or your team needs right now [I have been part of roughly >50 interviews till this time, and hiring is also one of the data source for this blog post]
  2. Coaching and mentoring : If you know various types of developers and based on that if you identify someone is of some type and he/she should work on X/Y/Z to be of some else type etc.
  3. Forming team: When you start a new project, and you are one of the team selector, Then it will be good to know and make a balanced team.
  4. Self improvement: After reading this post, and If you agree what I am going to say then this post might help you to identify your type and work towards improving other aspects and be THAT BEST DEVELOPER Which World is searching for!

Enough reasons to convince you to read this further? 🙂
I thought a bit and then came a Eureka moment — Where an idea came, Why don’t we use Venn diagram to explain this! And I’m excited to share output with you:
Let me explain these types in detail:
Mainly they are based on their thinking style

  1. Technical : They are super technical. They know each technology as soon as they are available. They would like to get their hands on it and would love to implement it in their current/future project. There are quite a few who will try to fit new technology without even fully understanding it. But they will have solution for all technical problems. And each project must have at least one of  them. They make good Technical Architect or Technical role.
  2. Business : This type of devs will understand business very well. They speak client’s language and that’s why most of the time client loves to work with them.
  3. Analytical : This person thinks all things from analytical point of view. (s)he will come up with the easiest and best solution which neither technical/analytical person can think of. They will not be super strong in technical. But If you pair this dev with Technical team member they rock
  4. Technical-Business-Analytical: And you know that sweet spot, when one person can think from all angles. YES, they do exist. But sadly they are very few and again this type of thinking takes sometime. Because when you are out of college, initially you think to solve everything using technology. Because that’s what you have been taught. But gradually, If you mentor someone closely they can come in this type in a longer run. Usually, This type of folks should be leading a team.

So, what makes a best team? It depends on lot of factors, e.g. Project complexity, Resource availability etc. But If you want to make super complex project successful. I would recommend, Combination of these types will rock your project. And that’s what I look for when I have to form a team — Sharing my secret with a wish that you will share with others!
Happy Team Building! 🙂

Technology trends you should know

After getting positive feedback on :
Thought to spend sometime to write a new comic on Technology trend! So, If you would like to learn about Latest technology trend then  this article is for you
Before you go further I would like to mention that this article would have not been possible without this article from Tess :
So. If you liked this article then the credit goes to her and NOT me. Because I just converted those learnings in comic — So, you enjoy reading it!
Let’s go!
In a small town there used to be a guy. Who was very had working. His name was Mr.Earner he was very busy in his project and personal life (like you!) and when one fine evening he was reading about latest technology trend. He felt that he left behind the technology trend. So, he went to church and prayed to Jesus for showing him path!
As always Jesus listens him and guides him to talk to Mr. Learner — Mr. Learner is a famous in town for his knowledge and knowledge sharing skills.
Keep learning, Keep Sharing!
Happy Coding! 🙂

Winning Teams Basics

As Cricket world cup has completed and Australian team won it again (Congratulations to them!), and apart from few people in India. Cricket is religion for most of us. You too – Correct?

“Winning is habit. Unfortunately, so is losing.” – Vince Lombardi

I know we lost in Semis against Australia – But as Dhoni rightly said “it’s a sport and only one team can win”. And let’s be honest guys and girls too – When Indian team went for World cup all of us, expected that these team won’t reach so far. And here’s when human expectations comes in to the picture,  When we started winning, Our expectation raised. And we wanted team to win world cup. But my personal view is that day Australia played good cricket. And we failed to do so. But I’m sure team will take a learning lesson from this and they do better next time! Sorry for taking conversation off track. But it shows, I’m same like you! When it comes to Cricket – We become experts. I personally believe everyone should follow/play at least one sport. It teaches you lot of lessons, which helps you in real life as well! Best lesson is “Match is never end till last ball” – Follow this rule in real life. At last moment (Yes, last moment) there is a chance that things becomes favorable to you. You just need to stay on the pitch! So, whatever the tough situation you are going through. Just be there on pitch! You might be thinking – Why there are few teams, who always keeps winning? And the other one always keeps losing? (In Cricket and in real life too). And I was thinking to apply this logic, in software industry as well. Why few teams always deliver software project successfully and smoothly. And other ones struggle to do so. As per my view there are two types of teams: Type1 : You can identify them using following characteristics:

  1. People love to be at office
  2. Whatever project they work – It gets successfully delivered
  3. No weekend work (If Project needs them, they will be happy to be available)
  4. Everyone goes at home happily and enjoys his/her personal life
  5. Passionate
  6. Enjoying each others in win
  7. They are always happy and cheerful
  8. Not Stressed

Typ2 : You can identify them using following characteristics:

  1. People look forward for way to not be at office
  2. Whatever project they work – It never gets successfully delivered
  3. Always in office during weekend (Few people like to be in the office during weekend for some research or something. But I don’t count them here. They belong to first team. I would consider people who don’t like to be in the office during weekend. But have to be, as SOMEONE has ASKED them to do so)
  4. Not so passionate – Doing something for just sake of doing
  5. No team bonding
  6. Always frustrated
  7. Always stressed

Sounds similar? If you belong to Type1, then you are the luckiest person in this world. But if you don’t know how it works? And would like to understand few reasons behind it. Then this blog post is for you. If you are in Type2, then I’ve an empathy for you. And would suggest that you work out on following points. They will surely help. And if you don’t have that level of control or someone is stopping you from doing so. Would suggest – Get off the bus! So, let’s see what special Type1 team does to be there:

Disclaimer : This is based on my learnings. I am not expert on this subject. But few basics which I learnt through my journey and have noted it down. Which I am sharing with you. So, if you think something might not work for you. Feel free to ignore it

  1. Leader: I believe team and team’s leaders makes most difference. Because if leader is not secure. Then he/she won’t let team grow. And then the culture becomes worst and worst. But if leader is confident, technically sound, and smart and get things done person. Then team also follows him/her. So, while making someone a leader, please think twice. “People don’t leave company they leave bad leader/manager” And if you are a leader, then I request you to give your best. Because I believe – The responsibility what our Teachers had at School/College level, Parents had at child level, the same level of responsibility leaders have at professional level. “Good leaders create leaders, and others create followers”
  2. People : If Leader is important, Then People working in the team are also equally important. Because people get things done and NOT Process. It makes me amazed that lot of companies focus on setting up good process. But I believe have good people, the process will be automatically good. Their Hiring Process is very strict. They can identify the talent, and know how to groom them! “Only good leader’s eyes can spot, good candidates/leaders”. While Hiring they keep person’s attitude first and technical skills second. Because it’s easy to impart Technical skills than attitude!
  3. Culture  : Company’s culture also makes difference. Always hire smart people, and let them do what they think is right. Company should just act as a facilitator. See Google’s work culture!
  4. Timesheets : I agree that time-sheets are good way to track and manage your time. Because based on that we bill to clients. But at times, people just work to fill in their 40 hours. And in this process they lose their creativity and helping nature.
  5. Team bonding : They not only enjoy and spend time with each other in office. But out of office as well. They do spend lot of time together! Type2 teams works more as individuals
  6. Communication and Transparency : Communications are very clear in these type of teams. Things are Green/Red.  Anyone can speak out. All things are 100% Transparent. Feedback system is also good!
  7. Training : They have very good training process. So, when someone joins the team. He/she knows what/how these team works. Before he/she gets bombarded with so-called strict deadlines. And lack of training makes it stricter!
  8. Balanced between experience and fresher : They have good balance between fresher and experience. Because both combination is required. But as good cook knows, the best ingredient to make good food. Same logic applies here as well. Experience people brings the lot of knowledge and best practices in to the team, at the same time. Freshers brings the lot of new perspective in the team. And while working together, they share those things with each others. And at the end of the day – Everyone wins!
  9. Clear expectations : As I mentioned in #1, Leader is very important. Because Good leaders are always good in communicating expectations clearly. I believe most of the time Type2 are frustrated because of this reason. Leader and Team members are never in sync with their expectations. I think, as a leader if you let people know what is right and what is wrong. And what you expect from them. Then they make sure they do it!
  10. Allowed to make mistakes : Team is allowed to make mistakes. But yes, they are not allowed to repeat them. But as Type1 team learns from mistakes. They rarely repeat any mistake. How leaders should manage their team success and failure- Dr. A. P. J. Abdul Kalam
  11. Learning from mistakes :  As Type2 teams are always busy. They just keep running because they are busy. But they never take a step back, and think what is keeping them busy? What mistakes they are doing? How they can learn from them? And Type1 team always learn from their mistakes and shares it with others. So, they don’t repeat it. And that’s how they get things done faster.
  12. Ready to help : They are always ready to help each others, and ready to go out-of-the-way for team
  13. Competition: They don’t compete with each other, they complement each other. If they have competition. That will be healthy completion. Who commits more backlogs/tickets in this release? 🙂 And Competition stuff happens with most of us. Because since school level. We’ve been asked to be first. In Public Transportation (Bus/Train) as well, we always try to be first! But those concepts doesn’t fit while working in a Team
  14. Helps others in down time : The time is not going to be same for anyone. Sometime X is doing well, at that time, Y is struggling. And when Y is doing well. X is struggling. In all situations they help each other during someone Else’s down time
  15. Links : You may find few more points from my earlier leadership posts:

Remember TEAM == Together each achieves more! Sounds good? Have I missed something? Would be happy to incorporate your views.

It is better to lead from behind and to put others in front, especially when you celebrate victory when nice things occur. You take the front line when there is danger. Then people will appreciate your leadership – Nelson Mandela

Raspberry Pi Quick start guide

Howdy Friends – Sorry for being away since so long. But have been super busy with lot of things. And still lot of things going on. Unfortunately unable to find time to write a blog and share knowledge (I know you don’t find time. You have to allocate it. And yes — Somehow not able to allocate it.) But I’m sure soon will be able to share my learnings with you! And today’s blog would like to dedicate it to Sir Abdul Kalam. He has always been an inspiration for most of us! (Including me and you!). And when I read his following quote – I thought will work extra and get this blog out – Just for you Sir!

What is Raspberry Pi? And what’s the usage of it?

If you haven’t heard about this then you need to come out of your cave. Because lot of techies are talking about this. Especially during March is for Makers movement. No worries — Will help you to understand it.
For Basics — Let’s talk to our friend wiki The Raspberry Pi is a series of credit card–sized single-board computers developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.”
So, It’s a tiny computer for fun if you are techie and If you would like to inspire kids for learning programming, getting acquainted with computers and start thinking about using Technology to solve real world problems. This is a perfect start! I would strongly recommend you following links:


Also, I see this device got lot of capabilities for Schools and Kids. Because every Kid will have TV at their home. And using Pi they can convert to computer in around 3-5 K (Pi, Wireless Keyboard, Dongle etc.) and they have a machine ready. On which:

  1. They can do programming!
  2. They can access FULL Internet! (Obviously will need Internet Connection) – Access educational material, explore the world!
  3. They can play games
  4. And you never know — Their might be future Bill Gates/Steve Jobs who might be think of great idea — Which might change the future!

I know I am very optimistic. But possibilities are immense! And If someone gets interest in Computers/anything at this age — Then they will surely do miracles!
It looks like, I’ve portrayed Pi as a Kids computer. But wait a minute. If you are not Kid then also this is super useful to solve some real world problems. Few examples:


Sounds interesting?! Eager to get your hands on it! That sounds good!

How to get it?

You can buy it from Raspberry Pi distributors :
While I am writing. Current latest model is :
You can also order it from Amazon. I’ve ordered this one : (Yes, It is from — During my U.S. Visit — I got it – Thanks to Nathan Miller — My colleague for helping me to get ordered it using his Amazon account]
This one is complete Ultimate Starter Kit. It is not required to order complete Starter kit. You can order stuff what yo really need. But If you ask me – I would suggest ordering complete Starter kit — Because it contains everything at once! And things become really easy! But again, this suggestion doesn’t apply to you. If you have budget constraints.
And thanks to CanaKit folks. Everything was perfect!

The kit also includes a 2.5A / 5V USB power supply specially designed and tested for the power-hungry Raspberry Pi 2. The included 2.5A adapter comes with a 5-foot cable and can power the Pi2 and other USB accessories (such as most portable hard drives) without requiring an external powered USB hub.
Kit Includes:
1 x Raspberry Pi2 Model B 1GB
1 x 8 GB MicroSD Card – Raspberry Pi Recommended MicroSD Card with the new NOOBS
1 x Raspberry Pi 2 Case
1 x CanaKit 2.5A MicroUSB Power Supply specially designed for the Raspberry Pi 2 (5-foot cable)
1 x Premium Quality HDMI Cable (6-foot)
1 x WiFi Adapter/Dongle (Ralink RT5370 chipset)
1 x Set of Heat Sinks
1 x Breadboard
1 x 40-pin GPIO Ribbon Cable
1 x 40-pin T-Shaped GPIO to Breadboard Interface Board
2 x Push Button Switches
2 x Red LEDs
2 x Green LEDs
2 x Yellow LEDs
2 x Blue LEDs
10 x 180 Ohm Resistors
5 x 10K Ohm Resistors
1 x CanaKit General Guide for Beginners to Electronic Components
So, go ahead and order one — right now! You already have it — Perfect! Then let’s see next section!

I have got it – Now what?

  1. Unpacking : Unpacking is very easy. And you can find a lot of online tutorials for it.
  2. Installation and Configuration : If you’ve ordered complete kit — Then you will have one Micro SD Card with NOOBS [New Out of Box Software] on it. If not then you can follow this instruction to install NOOBS on your card : — Just follow the instructions. You will have your Pi up and running! [I was not lucky, my initial journey was bit bumpy. I spent the couple of days starting my Pi. But I think during that journey. I learnt a lot more about it. Please refer “Few Challenges” section for more info] This is also good :
  3. Few commands : Make sure you read these links and run these commands :
  4. How to configure WIFI? : In case you have configured WIFI in your laptop and forgot password of it. Then you can use this link to get it : then these links helped me to configure WIFI :
  5. How to enable Remote Desktop? : Using this link you can configure Remote Desktop for your Pi : means you can disconnect your Pi from Monitor and can access it using your laptop or machine!

What was my First Project?

As you know in programming world. When you start learning any new language you start with “Hello World”! In Maker’s world it is Starting an LED using your python script — Trust me when you start LED — That feeling is just awesome! To do that, I followed this article :
Make sure you follow first step and your LED should light up without any program — If it is not lighting up. Which means your connection is not perfect

Pi Connected with Breadboard and LED light up!


Pi GPIO Header Quick Reference

Now, Let’s do it programmatically!

  1. connect your one cable to – GPIO 27 and another one to Any Ground
  2. Make sure you’ve setup your circuit as per schematic mentioned in an article
  3. Make sure you’ve opened Python IDE using terminal as mentioned in an article
  4. Your code should look like this:

[sourcecode language=”python”]
import RPi.GPIO as GPIO ##Import GPIO Library
GPIO.setmode(GPIO.BOARD) ##Use board pin numbering
GPIO.setup(13,GPIO.OUT) ## Setup GPIO on Pin13 to out
GPIO.output(13,True) ##Turn on GPIO pin 13
Run it, and your LED should light up!
After that, I wanted to ON/OFF this LED using my mobile! — And we did that using Flask – Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. Basically it is a web server — Which is easy to set up and run! – Trust me — Super easy! — Once we started web server — Then it was very easy to get it done. And then connected my mobile in same WIFI — And accessed URL. Using which I can start LED ON/OFF from my phone!
Few things to keep in mind:

  1. Make sure you connect your board correctly. Basically all pins should be touching the bottom portion of breadboard. Good read :
  2. When you connect your GPIO Ribbon cable make sure RED line is at right side — Or at First GPIO
  3. Understand GPIO numbers — — It will save a lot of your time!

Few challenges:

When I was configuring Pi with my old monitor [VGA to HDMI Converter], PS2 Mouse and Keyboard [PS2 to USB Converter]. I was getting following error:
Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

Referred all above blogs. But nothing worked. But after changing it to new monitor with HDMI Cable and new Wireless USB Keyboard and Mouse — It started working! So, I am sure it was hardware failure!


I hope this article helped you to understand Basics of Pi and inspired you to get your hands on it! This is just begining — Lot of things can be done using this. And it will be done in upcoming days — Just need to find sometime!
Special Thanks to Daniel – For helping me understand all the basics!

You are starting your career in IT Industry? Here are my learnings for you!

Hello Folks, Sorry I am facing challenges in keeping this blog updated. I wish can get more than 24 hours :-). I know it’s not possible. But will keep posting on this blog. Because from this blog only I got to learn lot of things. While sharing things with you. Quantity will be less compared to earlier. But quality will be same/more than earlier for sure! Because I believe in never compromising with quality!
Start-CareerMonth of May-July is the month, when every company starts on-boarding university/college pass-outs in their company. So, lot of new people start working professionally in IT Industry. So, if you are one of them — I welcome you to an IT Industry!
Now, when you start working in this Industry, You feel lot excited. But more confused as well. Because what you learnt in college, and what people do in industry is totally different, until and unless you are from Good College/University. Who encourage to have working professional as a guest lecturer.
When you start working for any company. And you got a nice mentor — Who can clear all your doubts, Help you understand what is right, what is wrong, Guide you in getting comfortable with all the tools and terminologies, Who is always there for you. But if you get one then you are lucky!
As per my view good mentor should have :

  1. Lot of patience
  2. And passion about the profession what they are in

When I started my career, I’ve been lucky at times, by having great mentors, who taught me What To Do, And How To DO. And have been super lucky to have some not so good mentors, from whom I Learnt — What Not To Do, How Not To Do, And How Not To Behave. And my big thanks to second one. Because I learnt a lot from them then the first one!
Since few year, I’ve been lucky enough to mentor — super talented and smart people. And I’ve thoroughly enjoyed them shining. Because they were Diamonds. I just got a chance to polish them and make them shine! You are also a Mentor? Then buddy you got a big responsibility on your shoulders. Because I believe Mentor has to play a role, Which Parents played during nurturing, Teacher played during School/College. So, when your mentee comes to you with small questions — Don’t lose patience, answer them politely.  Quench their thirst. And while doing so, you will learn a lot of new things — It’s a two-way process. I learnt a lot from my students. Basically if we just look around, We’ve a lot to learn from each others! — John West Sitecore CTO nicely said on Mentoring:
When a new developer joins your team or project, be friendly and let them know you are available for a two-way learning process. If an inexperienced Sitecore developer has a newbie question, instead of ignoring it or feeling frustrated, show that you care, take pride in trying to educate them on the topic, and try to provide pointers to the next few areas they could research. This works best when we all approach it the same way. Consider everyone with whom you interact to be both your mentor and your mentee. When I used to teach CMS training, I was surprised constantly by how much I learned from my students. In fact, I think each of us has something to learn from every other individual.
Source :
You may also like these:

While mentoring them, What I used to do, used to go back in my career and check, What Good things I learnt? — So, I can pass on to them. What Bad Things I learnt? — So, I can’t pass same to them. What I haven’t got? — So, I can get it for them.
So, each year – I meet a lot of young people joining our industry, and I make sure I share my learnings with them and help them shine! At one evening I thought, At each year — How many young folks — I will meet — 4,5,6 That’s it! — So, Why don’t I share my learning via my blog. So, who are starting your career, can focus on it. And if someone is new in mentoring and one of my learning can help them then I feel paid off!

Disclaimer : This is based on my learnings. I am not expert on this subject. But few basics which I learnt through my journey and have noted it down. Which I am sharing with you. So, if you think something might not work for you. Feel free to ignore it

Let’s go!

  1. Learn : When you start your career, Keep focusing on Learning and NOT Earning! [As Allan Border Said to Harsha Bhogle — Take care of the runs – the dollars will take care of themselves.] An Advice I follow and give — For Initial years — Just learn as much as you can! Spend as much as time you can to learn the things, understand things. Ask questions. Do R&D
  2. Mentor : If possible find a Good Mentor and follow him/her
  3. Don’t Say No : If some new task is coming up to you. Don’t say NO — If you don’t know, tell them I will need sometime. But i will do it.  Be a Go-Getter [Quotable Quote : Richard Branson — ‘If somebody offers you an amazing opportunity but you are not sure you can do it, say yes – then learn how to do it later!’] But Yes, don’t get overburdened and over commit.
  4. Give Respect : Give respect to your seniors, subordinates and even office peons!. Be a team player! And they will love to work with you!
  5. Master your Skills : Whatever skills you are in for example .NET Developer/Java Developer/QA — Master it! And to be different from crowd — Get your self certified — I did most of my Microsoft Certifications during initial years — It not only added value. But also clarified lot of my basic thoughts about programming, I came to know lot of new API — Which made my work easier, and faster. [Yes, please read Microsoft certification books before giving exam, and DON’T GIVE EXAMS BY JUST READING DUMPS]
  6. Focus on your Coding Standards : They will consider that you care for your code!
  7. Read Read Read : In the era of internet as well, disconnecting from live world and reading a book for Minimum 30 minutes Enriches you. First read as many technical books you can may it be – OOPS, Design Patterns, .NET Frameworks, 97 Things every programmer should know or talk to your colleagues and find out which book they like more. Apart from that read the books you like Fiction/Non-Fiction/Self Help — This will keep you motivated! This is so long back I wrote on World Book Day : Did you know that, today is World Book day?!Books can be really your best friend! – Who gives a lot, and asks nothing in return!, which expands your vision about life! Who helps you to stand like a rock in difficult situation! Who makes you laugh, who makes you cry!If you read technical books – your technical knowledge will get increased and if you read other books (Biography, self-help, novel etc.) – your life’s knowledge will get increased – at last you will feel enriched for sure!It’s interesting, when I talk to people and ask about reading books they say – “Where is time to read the books?” – It’s same as driving a fast running car. But you don’t have a time to fuel it!:-)In this fast pacing era, promise yourself to daily read for min. 30 minutes, it will surely change your life – it worked for me, and I’m sure it will work for you as well!So, grab a copy of a book which you was “planing” to read from a long time and start reading it “today”!Happy World Book day!
  8. Document your learnings : In your initial days you will learn new things at every footstep. Our teacher taught us, Whatever new thing you learn document it. So, your knowledge gets organized in a proper manner, it gets stored in your permanent sector. And if you can write  your blog then nothing great like that! The one blog you are reading is the best example of it! It improved my writing Skills and when people comment on blog — “You saved my day, God Bless you!” — That’s the best feeling you can ever have — Good Reads : and
  9. Communication Skills : Sharpen your written and verbal skills. Because along with compilers you’ve to work with HUMANS. And when you get stuck with something. You’ve to explain it nicely to your senior, colleague, subordinate, Or In Global era to someone else sitting in U.S/U.K Or in Forum or To Support guys. And before you start working you’ve to understand requirements as well. If you can’t deliver something as committed, please communicate before hand.
  10. Develop Tools —  When you learn something new in Technology. Think of how you can use it in your day-to-day life. If not in your project then can you build a small tool for your personal use or professional use or for your company’s use? It will give two benefits — It will clarify your concepts thoroughly, and at the end of  the day, you will have a tool which simplifies someone’s task. See Tools i wrote for fun — PolyglotSkype, TimeZoneConverter or you can start your open source project on GitHub!
  11. Stand in tough time :When something is not working and the whole team is in tough time. Go and stand their. You might not be able to help. But see what you can do. At times fresh perspective might show a way to solve a problem! And you learn more in tough situations than day-to-day situations!
  12. Share Knowledge — Learnt something new? Share with someone else as soon as you can! Don’t feel insecure while sharing the knowledge. Good Read :
  13. Track your progress : Periodically, take a halt and check how you are moving? What good things you did? What bad things you did? If needed talk to your Mentor/Senior and ask for an HONEST Feedback — Don’t wait for Annual Appraisal. BTW, I’m big fan of writing Journals. Give it a try, It will give you astonishing results!
  14. Usergroup meetings : If possible go for user group meeting
  15. Focus Focus Focus : Be focused, In this era of Social Media, you have no idea, how much of your time this social media mediums can eat. I’m not against in being touch with friends and family — That matters a lot! But while you are working — You are working! And When you are playing, You are playing — Then don’t work! I believe in “Work Hard, Play Hard” And you got finite number of key strokes in your life, please don’t get it wasted — Check your keys left : [I have only 156,038,394 keystrokes left before I die.] and “Choose a job you love, and you will never have to work a day in your life.” – Confucius
  16. Quality : Never Never Never compromise on quality. If you’ve to delay your software delivery by a day or deliver one feature less — In place of a quality — It’s a good deal! If you’ve to burn yourself for a quality — Just do it! Steve Jobs is the prime example of quality lovers and he nicely said “When you’re a carpenter making a beautiful chest of drawers, you’re not going to use a piece of plywood on the back, even though it faces the wall and nobody will ever see it. You’ll know it’s there, so you’re going to use a beautiful piece of wood on the back. For you to sleep well at night, the aesthetic, the quality, has to be carried all the way through.” Good Read :
  17. Be Efficient  : Complete your assigned tasks on time. Do a Time management. Say No where you can Say NO.
  18. Be Responsible : If you take more responsibility you will be assigned on more and important projects — and you will be important player of your team!
  19. Basics : And one advice, I always give — “Always Stick  to your Basics” In whatever things Technical/Non Technical — Because it matters! “Back to Basic, Stick to basics, because a basic always works!”

Have I missed something? Feel free to comment
I hope this pointers, help you to shine in your career! Always Remember — “No idea works, Unless you do!”

“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover.”

And If you need any help from my side, Just give me a shout!
Have a Happy and Nice Vacation! 🙂 [“When Passion becomes Profession, life Becomes Vacation!”]
Good Reads:
Driving Your Career :

ASP.NET Website Performance Basics – Part 2


Recap : In last part of ASP.NET Website performance basics, Dax shared basic methodology of troubleshooting ASP.NET Website performance challenges!
Where he shared, what all things we need to do, and why we should do it (Remember W-W-H theory?). And just pointers of How to do it! And as Dax promised, that he will help us to understand how part more [We all know, how well Dax keeps his promises! :)] and here he is.
In this post [Would also name it “ASP.NET Basics”], we will look at following things (Which are very IMP. to diagnose performance issues):

  1. When you open any website from your browser, what all happens, behind the scenes? — Not related to ASP.NET just basics, how it reaches till your ASP.NET Application
  2. Now, we’ve reached to ASP.NET Application, after that we will look at — ASP.NET Application LifeCycle — All about — HttpApplication,HttpContext,HttpRuntime, HttpModules etc.
  3. Request Queuing
  4. Major Performance killers ( Hanging Requests, Session can slowdown your application — Thread Agility Issue, Exceptions and performance co-relation, MaxConnections, High GC, Contentions, App Pool Recycle, Memory leak)

Above topics sounds similar? Very Basic? (Back to Basics, Stick to basics. Because a basic always works!) But still unknown? (During our interview sessions, we ask these questions to most of our candidate, And so less can answer it)Don’t worry, we will learn it, So, as Dax and his team!
Here we go!


When you open any website from your browser, what all happens, behind the scenes?

You might know this question or learnt it during your college days. And If you are pretty much confident you know this you can skip it. But Dax recommends that even though you know it. It would be a good idea to brush up this stuff.
Because while working on performance stuff, you need to know about everything starting from Client’s Browser, DNS, Firewall, Switch — You no need to be expert in this subject. But when you troubleshoot it, You should know all these players very well.
My favorite — one is from MCTS 70-528 exam book – Chapter1-Lesson1 – Understanding the PlayersMajor-Players
Another good articles:

Good to remember about M-H-P-M
Thanks a lot to author of above articles. It clarifies everything. So, now you know what all happens — from browser till server — a request goes through a journey and then gets served!
Here you must’ve seen about HttpApplication object, this guy is very critical while serving your requests.  HttpApplication consists of HttpModules.
HttpApplication Gotchas:

  1. ASP.NET may instantiate many instances of HttpApplication as required (. In fact, it will create an instance of the class for each request that is handled in parallel on the server.
  2. “ASP.NET maintains a pool of HttpApplication instances over the course of a Web application’s lifetime. ASP.NET automatically assigns one of these instances to process each incoming HTTP request that is received by the application. The particular HttpApplication instance assigned is responsible for managing the entire lifetime of the request and is reused only after the request has been completed. This means that user code within the HttpApplication does not need to be reentrant.”
  3. You can observe pipeline instance count in the performance counters to see how many instances of your HttpApplication class are pooled at the moment.
  4. In Integrated Application mode — HttpApplication will called once during application initialization and another during the first request
  5. When ASP.NET Creates Instance of the HttpApplication class that represents your application, instance of any odules that have been registered are created. When a Module is created, its Init method is called and the module initializes itself. — and the custom module will run for all resource handler, even though resource handler is not an ASP.NET handler
  6. If you see More number of requests [You can check it via IIS log or performance counter] and Heavy HttpApplication Instances is Normal, Because it means that current HttpApplication Pool was not enough and ASP.NET need to spawn worker processes.
  7. But if you see less number of requests, and still see heavy HttpApplication instances then it is abnormal. We need to find out slow pages/handlers etc.
  8. ASP.NET run-time keeps two pools of HttpApplication objects. First is a special pool with HttpApplication objects used for application level events (such as Application_Start, Application_End), Second pool contains instances used in requests to serve all other types of events
  9. Try this out —
  10. HttpApplication Events

Other good reads:

Huh! Load of things, correct? Useful? Dax says these information is really useful and it will clarify your understanding more on ASP.NET internals!

Request Queuing

It is really good to know about Request Queuing, lot of us already know about Request Queuing — Simple, a Request is queuing. Yes, my dear friend you are right. But there are different level of Queuing happens. And untill and unless you know your request is queued at which level, it won’t be easy to fix it!
Great post! —
Basically, Request Queuing can happen at mainly 4 levels:

  1. HTTP.SYS: Application pool queue
  2. IIS worker process: completion port
  3. ASP.NET: CLR threadpool queue
  4. ASP.NET: Integrated mode global queue
  5. [OR]ASP.NET: Classic mode application queue

Request_Timeline2 Req-Q
Source —
To diagnose, your level of Queuing. Best thing is performance counters [Dax, is going to share more on performance counters in his upcoming posts] and once found you can use tools like FRT, Dump analysis etc. to find a main bottleneck [Yes, Yes — Dax will post on these topics in future for you!]

Major Performance Killers

  1. Application Pool Recycle/Crash — If your application pool is crashing is or recycling [How Can I check that? You can check EventLog OR if your application got log do log entry [Just a note : Application_End will not get called, when your application crashed unexpectedly a.k.a. Crash] — see —] periodically than it’s not good for your application’s health. Because when application pool gets recycled everything in memory [Session/Cache/Static/Application objects] gets lost, and your application need to server everything from Database and rebuild cache. You can solve this issue by checking EventLog and Configuring+Analyzing Crash Dump. and
  2. Hanging Requests — Your users are complaining that the site is loading slowly. Requests to your application are hanging. With so many possible causes of request hangs, its difficult to know where to even start. —
  3. Exceptions, handle them gracefully — Exceptions can slowdown your application. Because when your application throws an exception — It Creates objects — CLR needs to do object allocation — And after that GC for those allocation! [Analyze your application logs to see exceptions, and handle them gracefully] —
  4. %Time in GC — When this time is high, your requests will get paused for a while and your end users will see slow response time during this time. If it is >=10% then you need to dig in to this issue.  Also, check for Memory Leak —
  5. Contentions — If your CPU is not being utilized and you still see low throughput, you may be suffering from high contention rate. Means your code has lock on shared resources, which is taking time to process, and due to this other requests are going in Queue. Simple concept in locking — “Acquire lock as late as possible, and release it as soon as possible”
  6. Session lock – Thread agility issue Disable session for the pages/handlers, where you don’t need them.

Good to read resources:

  2. Most recommended —

Sorry for such a long post. But It’s good to clarify basics. Because once it is clear, you can fix any issue!
These are the common performance killers, In upcoming posts, we will see how to diagnose them! Till than Happy Performance Tunning! 🙂

Leading is like parenting!

Thanks a lot for appreciating my first article on non-technical subject! (You haven’t had a read at it? Come on, lot of people liked it, and I hope you too! — Leadership basics!)
Your motivation has inspired me to write another blog post on same topic, leadership!
Leading is like parenting!, yes you heard right! Leading is like parenting! — This is what I’ve observed and analyzed, good leaders are like good parents! Not convinced correct? I know you are an engineer, to who E=MC2 also needs to be proved! 🙂 Let me try to prove it!
Below are few of the characteristics of good leader and good parent: (Just a note : Let me repeat, it stands true with good parent/leader. If you apply negation and read it again everything will be true in other way!)




Takes care They always take care of their team members, day in and day out they keep thinking about team! Do you agree that parents do the same? Parent always think of their Kids and they take best care of them, and if they need to suffer a bit for doing so, they will do it? So, as great leaders!
Future They always think about their team’s future! What’s good for their Kid!
Appreciates They appreciate in public If they have identified any quality of their kids, they will appreciate it In public and lets everyone know!
Criticizes If something is not right, let team member know, right now. Before it gets tough to manage! Can easily let you know, what wrong you are doing!
Laugh with you and shout on you! They laugh with you, But if he/she feels you are spoiled down, just give a shout in private! And you will never feel bad on their shout. Because you know they are saying for your goodness only! They always do this for our great future!
Holds your finger During your initial days, will hold your fingers and help you to understand everything! Do you remember who taught you how to walk? As far as I know, still this point of time there is no any APP in Android/App market for doing this! 🙂
Steps back When you are ready to fly, you won’t come to know that he has taken a step back and watching you from a distance, that how you are performing! Riding a bicycle, he/she will be with you still some point of time, and still the time you realize he/she is not there, you might have learnt how to ride a bicycle!
Protective With them you feel safe, they protect you from outsiders! You always feel secure with them!
Let you fail Good leaders, always protect their team. But at times, they let you get failed! Do you know why? Because If you haven’t learnt how to deal with failure, other things are in vain. Also, failure is a lousy teacher! If success teaches you 1 lesson, failure will teach you 100! – I firmly believe that “Failure is the key to success” They know, that If you can’t manage handle of a bicycle you will fall down. So, what? This is beginning and then only you will learn to wake up and say again! I will do it this time!
When you are down, they will make you up! Okay you failed, you are down! Feeling bad? Just turnaround, good leader will be standing next to you to motivate you and help you how to get out of it! Whatever worst happens with you, they are always by your side! Because they know you are right! – And trust me with their support you can overcome any situation!
Clear expectations They Communicate expectations to you and vice-versa! If you get distinction, will get you this?
Trust you Whatever happens they trust you! Always have a full trust on you!
Let you enjoy! Let you enjoy, with task and sometime without task as well! Let you enjoy your life without any interruptions!
Motivates to learn Always motivates you to learn, something new. Even though sometime you think I’ve learnt a lot. But he/she got some plans for your future! And you like it or not, will ask you to learn, learn and learn! And you see benefit of it in a longer run! Do you remember, your parents always telling you study, study, study? And you wanted to go for Cricket, TV and Games. But they made sure that you do your studies! And see today you are Engineer! 🙂

Happy Leading! 🙂

Leadership Basics

My dear readers, thanks for your support since ~5 years for appreciating my each and every blog by your invaluable reads, comments and suggestions — It always kept me motivated! (Just a note : It’s easy to start a blog. But it’s too tough to keep it updated! Most of you must be knowing this! and I would like to thank you for your support and motivation which kept me engaged on this blog! — Cordially, thank you!)
Since starting of my blog, I was sharing Technical stuff with you, and I’m sure you must have enjoyed it! Now, going to write this first blog post, which is not on technical stuff. But on leadership stuff i.e. Management stuff.
A question may come up in your mind, Now, this guy is moving to management and will not post anything related to code. Let me correct you, it will never ever happen for sure. Because coding is my passion and can’t live without it! But thought to share leadership learning with you for following reasons:

  1. As per my experience and observation, have worked with few nice leaders (and at the same time few bad as well!) and would like to thank both of them. Because knowing what not to do takes more time than knowing what to do! 🙂 and the other ones helped me to do so very quickly! In this blog post, will try to summarize the characteristics of a good leader [what I’ve seen], it’s solely based on my observations and reading whatever I had during my working experience as a leader since 2 years!
  2. Lot of you don’t know that, there is a leader within you! (This blog will help you to identify a leader within you!) Just check how many characteristics matches with you! (Don’t worry same happened with me as well, Because before two years, when I came to know that I’ve to lead a team — I was not ready for it! 🙂 )
  3. Or if you would like to be a good leader or already a leader and would like to improve your leadership skills then also this post will help you!
  4. If you are in a senior management and would like to identify a leader for your organization, this post may give you reference pointers!

Just a note : Let me repeat, I’m not a leadership guru. Whatever characteristics I’m going to share is just based on my analysis, observations,reading and working experience!
Let’s start! (Just a note : will write pointers or one liners only. In future, will expand few points from following list If you think you need detailed explanation on any pointer, feel free to drop it in a comment)

  1. Honest — still honesty is the best policy!
  2. Give his/her best in turbulent times — Whenever any crisis happens, they are the first one to solve them! They flourish in tough time! And spot them they are the great leaders!
  3. Transparent — No encapsulation please!
  4. Learn from mistakes — Someone did something wrong, don’t worry he/she is a human being. Just analyze the mistake and make sure you don’t repeat it and move on!
  5. Back your guys — Always back your guys, mostly in tough time!
  6. Cover them — Mainly from outsiders!
  7. Be open to them!
  8. Give honest feedback — Appreciate is public variable, and criticize is private! And do it on time! — If someone did a mistake/did something good don’t wait for his/her appraisal appreciate right now!
  9. Promise — Always fulfill your promise! Or take a note of it!
  10. Never bad mouth your team
  11. Take care of them — And they will take care of yours! Even their small needs e.g. Mouse, Keyboard desk etc. It matters a lot!
  12. Communicate — Whatever small things, each one of your team member should know everything. [Obviously, not the confidential one!]
  13. Inspire/Motivate them — “If your actions inspire others to dream more, learn more, do more and become more, you are a leader.” especially when they feel down!
  14. Expectations – Communicate your expectations to them and vice-versa!
  15. Always challenge them and sometime it’s good to keep them on their toes!
  16. Know them personally — Because people perform better when they get to work what they love to work!
  17. Speak with them — Every time you should not discuss about work, sometime just have a casual chat with them!
  18. Have a one to one meeting — Monthly?
  19. Share knowledge with them — Don’t feel insecure!
  20. Always give credit to them — and never accept any credit!
  21. Do their HR process rightly on time!
  22. Laugh with them
  23. Never order them — Rather than saying “You have to do it?” you should say “Can you please do it for me?”
  24. Be thankful to them – Because they make your life simple!
  25. If they are stuck somewhere — help them out!
  26. Roll your sleeves up — If needed, don’t be afraid to roll your sleeves up and start coding! This is the most IMP. characteristics!
  27. Fight for them — Fight for their rights!
  28. Always be cool and calm before them! — Never let them know that you are angry!
  29. Always be accessible to them — It’s frustrating for your team mates, if your are not accessible to them whenever they need you!
  30. Quick thinker — Think quick! and mainly act upon it!
  31. Act promptly — No one likes a leader, who just takes an issue and works on it for ages, we are living in 4G world! 🙂 Take a decision and act on it!
  32. People feels safe while working with you!
  33. People love to talk to you!
  34. Always positive!
  35. Take decision and back them no matter whatever happens!
  36. Always smiling face! 🙂
  37. Focused on solution — and not the problem or the problem source
  38. Never blames anyone!
  39. Expert in the field — I remember a nice line from Bill Gates — If you don’t know how to write a good code, then you can’t be a good leader. And trust me this characteristic will only gain you respect!
  40. Passionate
  41. Problem solver!
  42. Organized! Disciplined! [Still we are agile!]
  43. Best listening skills! — Always listen you!
  44. Caring!
  45. Always ready to discuss
  46. ______________________________

You can add your leanings here!
Helpful? As said earlier this my first management blog post, please ignore my mistakes and share your views about it! Will surely work on it!
And If you would like me to expand any characteristic from above list, just drop it in a comment. Will elaborate it for you!
Happy leading! 🙂

WCF Behavioral Contracts and Message Exchange Patterns


Architect was busy on other tasks, So, he was not able to share his WCF knowledge with you since last few days. He apologize for this!
Architect’s team liked his WCF Fundamentals notes and they requested him to share his all notes whatever he has related to WCF!
So, here’s the 3rd part (1st part, 2nd part) of WCF Story where our architect would like to share his WCF Behavioral Contracts and Message Exchange Patterns with you!


Here’s the discussion between Architect and his team!
Contract defines:

  • What service operations you are going to get?
  • How to format the messages you send to a given service.?
  • What will it do when it receives the messages?
  • What kind of response message you should expect in return, or if something goes wrong, what kind of fault does the service issue?

WCF Structures an overall contract by with its consumers by defining the following three core contracts:

  • Service Contract :- Defines which operations the service makes available to be invoked as request messages are sent to the service from the client.
  • Data Contract :- Defines the structure of the data included in the payloads of the messages flowing in and out of the service.
  • Message Contract :- Enables you to control the headers that appear in the messages and how the messages are structured.

Categorically there are two types of contracts:
1. Behavioral Contracts
2. Structural Contracts
Today we are going to delve in to first category — Behavioral contract
Behavioral Contracts

  • Tools to start defining WCF services.
  • It helps you to define how your service will behave (and in OOPs term we define class’s behavior using methods]

It focused on .NET attributes you need from System.ServiceModel namespace to specify the behavioral aspects of your WCF Service:

  • How the service behaves and what operations it exposes.
  • When the service might issue faults and what kind of faults it might issue.
  • What are the MEPs required to interact with the service? – Operation is request/response way, one way or duplex.

Basically there are 3 types of Behavioral contracts:

  1. ServiceContractAttribute
  2. OperationContractAttribute
  3. Fault Contracts

Let’s discuss them one by one.
Service contract describes the operation that service provide. A Service can have more than one service contract but it should have at least one Service contract.

  • It describes the client-callable operations (functions) exposed by the service
  • It maps the interface and methods of your service to a platform-independent description
  • It describes message exchange patterns that the service can have with another party. Some service operations might be one-way; others might require a request-reply pattern
  • It is analogous to the element in WSDL

To create a service contract you define an interface with related methods representative of a collection of service operations, and then decorate the interface with the ServiceContract Attribute to indicate it is a service contract.
Named parameter options:

Named Parameter Description
•Specifies a different for the contract instead of the default,
which is simply the interface or class type name. This contract name will
appear in WSDL.
•Specifies a target namespace in the WSDL for the service.
The default namespace is . It’s really good practice to provide

Just a note : Please note that there are other named parameters as well. But it has been omitted intentionally to make things simple.
[sourcecode language=”csharp”]
public interface ICalculator
double Add(double number1, double number2);

  1. Always use Namespace property to provide a URI that in some way uniquely identifies both your organization and the conceptual or business domain in which the service operates. W3C standard – year and month to differentiate versions of your service.
  2. Good practice to use the Name property to remove the leading I because I is more of a .NET idiom.


  • Can be applied only to methods
    Used to declare the method belonging to a Service contract.

Named parameter options:

Named Parameter Description
•Specifies a different name for the operation instead of using the default
which is the method name.
•Indicates whether the operation is one-way and has no reply.

Just a note : Please note that there are other named parameters as well. But it has been omitted intentionally to make things simple.
[sourcecode language=”csharp”]
public interface ICalculator
double Add(double number1, double number2);
Fault Contracts

  • When something goes wrong – what to do? (When service issues some faults then what type of information should be issued)
  • Faults (SOAP Faults) Vs. Exceptions (Exceptions) : Faults and exceptions are not the same thing. Exceptions, as referred to here, are a .NET mechanism used to communicate problems encountered as a program executes. The .NET Lang. allows you to throw, catch/handle, and possibly ignore exceptions so that they can be further propagated up the call stack. At the same point they should be handled else .NET runtime will terminate that thread.
    Fault, refer to the SOAP fault mechanism for transferring error or fault conditions from a service. The SOAP specification includes definition for SOAP Faults. Issue faults in a standard way.
  • WCF FaultException Class :- Provides standard mechanism for translating between two world of .NET Exceptions and SOAP Faults – WCF serialized your exception in SOAP Fault.
  • FaultContractAttribute :- enables a service developer to declare which faults a given service might issue if things go wrong. It can be applied to operations only and also more than once if needed.

[sourcecode language=”csharp”]
// Service Contract
double Divide(double numerator, double denominator);
// Service Implementation
public double Divide(double numerator, double denominator)
if (denominator == 0.0d)
string faultDetail = "cannot divide by zero";
throw new FaultException(faultDetail);
return numerator / denominator;
Message Exchange Patterns (MEP)
MEPs describe the protocol of message exchanges a consumer must engage in to converse properly with the service. For instance, if a consumer sends a message, it needs to know whether it should expect a message back or whether simply sending the request is enough. Further, can the consumer expect unsolicited messages back from the service? WCF supports
the following three MEPs:
1. One-way

  • One-way operation can be enabled by setting IsOneWay property to true in Operation contract attribute.
  • It can’t be used in conjunction with Fault Contract – Because it needs two-way channel.  Also, One way is not really one way!

In One-Way operation mode, client will send a request to the server and does not care whether it is success or failure of service execution. There is no return from the server-side, it is one-way communication.
Client will be blocked only for a moment till it dispatches its call to service. If any exception thrown by service will not reach the server.
Client can continue to execute its statement, after making one-way call to server. There is no need to wait, till server execute. Sometime when one-way calls reach the service, they may not be dispatched all at once but may instead be queued up on the service side to be dispatched one at a time, according to the service’s configured concurrency mode behavior. If the number of queued messages has exceeded the queue’s capacity, the client will be blocked even if it’s issued a one-way call. However, once the call is queued, the client will be unblocked and can continue executing, while the service processes the operation in the background.
[sourcecode language=”csharp”]
[ServiceContract(Name = "PizzaService",
Namespace = "")]
public interface IPizzaService
[OperationContract(IsOneWay = true)]
void CancelPizza(int pizzaOrderNumber);
2. Request / Response [Default Message exchange pattern]

By default all WCF will be operated in the Request-Response [IsOneWay property of OperationContractAttribute is false) mode. It means that, when client make a request to the WCF service and client will wait to get response from service (till receiveTimeout). After getting the response it will start executing the rest of the statement. If service doesn’t respond to the service within receiveTimeout, client will receive TimeOutException
Void method doesn’t mean OneWay. It can use Request/Response and it’s really good practice to use it because this MEP allows to receive faults.
3. Duplex
Duplex MEP is a two-way message channel whose usage might be applicable in following situation:

  • Consumer sends a message to the service to initiate longer-running processing and then subsequently requires notification back from the service, confirming the requested processing has been done.

Duplex MEP has following issues:

  • it’s problematic in real world because a service needs connection back to the client – Firewalls and NAT problems.
  • Not Scalable. – We want stateless.
  • You lose interoperability. Because to implement Duplex MEP we need to use Callback method in WCF. But what if client is JAVA – which doesn’t supports callback methods.
  • Threading problems.

In Short Duplex is Complex! – Avoid using it. Use it if you really need it! – Okay, then how to deal with above given situation without Duplex?
Stay tuned for next story! (Just a note : If you would like to get email update whenever new story get posted, please do subscribe using subscription form — given right side)
Happy WCF Programming! 🙂

WCF Fundamentals and Quick start


After receiving lot of appreciation and positive comments on my first WCF article Why we need Windows Communication Foundation? and suggestion from Manaday (Which was going back of my mind. But somehow I was not bringing it in implementation), Henceforth I am going to post full WCF Series based on last fictional story.
So, here’s the 2nd part of WCF Story where our architect would like to share his WCF Fundamentals with you!


Architect was kind enough to share his WCF Fundamental notes what he created for his team with you! [We should be thankful to him :)]
WCF provides API for creating systems that send messages between clients and services. Which can be sent either Intranet or Internet over TCP,HTTP,MSMQ, Web Services etc. Also it’s Interoperable!

Following are most of the concepts and terms used in WCF:

  • Message: Self-contained packets of data that may consist of several parts including header and body. All parts of a message can be encrypted and digitally signed except for the header which must be in clear text.
  • Service: A software module (EXE or DLL) that provides 1 to n endpoints with each endpoint providing 1 to n service operations.
  • Endpoint: A single interface that is used to establish communications between clients and hosts. Each endpoint has its own address that is appended to the base address of the service, making it a unique entity. A WCF service is a collection of endpoints.
  • Binding: A set of properties that define how an endpoint communicates with the outside world. At the very least, the binding defines the transport (HTTP or TCP) that is necessary to communicate with the endpoint. A binding may also specify other details such as security or the message pattern used by the endpoint.
  • System-provided bindings: A collection of bindings that are optimized for certain scenarios. For example, WSHttpBinding is designed for interoperability with Web Services that implement various WS-* specifications.
  • Service Contract: The contract defines the name of the service, its namespace, and other global attributes. In practice, a contract is defined by creating an interface (interface in C#) and applying the [ServiceContract] attribute. The actual service code is the class that implements this interface.
  • Operation Contract: Given that a service contract is defined by creating an interface and annotating it with [ServiceContract], an operation contract is a member method of that interface that defines the return type and parameters of an operation. Such an interface method must be annotated with [OperationContract].
  • Data Contract: Data types used by a service must be described in metadata to enable clients to interoperate with the service. The descriptions of the data types are known as data contracts and the types may be used in any message (parameters or return types).
  • Service operation: A method that is implemented and exposed by a service for consumption by any client. If a service contract is defined by creating an interface, then a service operation is the class that implements this interface.The method may or may not return a value, and may or may not take any arguments. Note while a method invocation might appear as a single operation on the client, it can result in sending multiple messages to the service. For example, a method with two arguments called on a WCF client results in two messages sent to the service.
  • Host: A host is an application (typically .exe) that is used to control the lifetime of a service. A host can be a console, a Windows Service, a Window Activation Service (WAS) and Internet Information Service (IIS) among others. For IIS, you can set a virtual directory that contains the service assemblies and configuration file. When a message is received, IIS starts the service and control its lifetime. When a client (or clients) end(s) the session, IIS closes the application and releases it resources.
  • Behavior: A behavior is a type (i.e., class) that augments the runtime functionality of a service. Service behaviors are enabled by applying a [ServiceBehavior] attribute to a service class and setting properties to enable various behaviors. Behaviors are used to control various runtime aspects of a service or endpoint. Behaviors are grouped according to scope: Common behaviors affect all endpoints, service behaviors affect only service-related aspects, and endpoint behaviors affect only endpoint-related properties. For example, an endpoint behavior may specify where and how to find a security credential.
  • Instancing: A service has an instancing model which controls how many instances of the service can run at one time. There are four instancing models: single, per call, per session, and shareable. The first two are similar in concepts to the Singleton and Single Call SAOs in .NET Remoting. Instancing is a behavior and and as such it is specified as part of the [ServiceBehavior] attribute as follows: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)].
  • Client Application: A program that exchanges messages with one or more endpoints. The client application typically creates a WCF Client Object and then calling methods on this proxy object.
  • Channel: This is the transport connection between a client application and an endpoint in a service. A client uses a transport (TCP, HTTP, etc.) and an address to construct a channel to a specific endpoint.
  • WCF Client Object: This a client-side construct that encapsulates service operations as methods, in other words, a WCF Client Object is a proxy to the service methods. Note that any application can host a WCF Client Object, even an application hosting a service. Therefore, it is possible to create a service that includes and uses proxies to other services. These proxies are typically generated using the svcutil.exe command-line utility.
  • Metadata: data that is generated by the svcutil.exe command-line utility. This data includes:
  1. XML schema that define the data contract of the service.
  2. WSDL to describe the methods of the service.
  3. Application configuration files.
  • Metadata exchange point: An endpoint with its own address that is used to publish metadata.
  • Security: Security in WCF includes encryption of messages, integrity of messages, authentication and authorization. These functions can be provided by either using existing security mechanisms such as HTTPS or by implementing one or more of the various WS-* security specifications.
  • Message pattern: The message pattern determines the relationship and direction of messages between the client and the service. The most basic pattern is the one-shot (or one way) pattern is which a message is sent to the server but not response is expected. The most complex pattern is a dual HTTP pattern where two HTTP channels are constructed between a client and a service, with both sides invoking operations on each other.
  • Reliable messaging: The assurance that a message is received only once and in the order in which it was sent.
  • Sessions: A session is used to establish communication between a client and a service in which all messages are tagged with an ID that identifies the sessions. If a session is interrupted, it can be restarted with the session ID. If a service contract supports a session, then you will need to use Instancing to determine how the class that implements the service contract behaves during the session. See the Duplex Message Pattern example in Designing Contracts chapter.

Basic WCF Programming Lifecycle

Here are the basic steps of WCF Programming Lifecycle – Order matters!

  1. Define the service contract. A service contract specifies the signature of a service, the data it exchanges, and other contractually required data.
  2. Implement the contract. To implement a service contract, create the class that implements the contract and specify custom behaviors that the runtime should have.
  3. Configure the service by specifying endpoint information and other behavior information.
  4. Host the service in an application.
  5. Build a client application.

Just a note : Although the topics in this section follow this order, some scenarios do not start at the beginning. For example, if you want to build a client for a pre-existing service, you start at step 5. Or if you are building a service that others will use, you may skip step 5.

WCF Quick start

Following steps will help you to create your first WCF service (In this example we are going to create two console applications one console application will be hosting the service and second one will be consuming the service):
Step 1 : Define a Windows Communication Foundation Service Contract : When creating a basic WCF service, the first task is to create the contract for the service that is shared with the outside world that describes how to communicate with the service. This contract specifies the collection and structure of messages required to access the operations offered by the service. This is done by creating an interface that defines the input and output types, which apply the ServiceContractAttribute to the interface and OperationContractAttribute to the methods that you want to expose.

NOTE : We need to add reference to System.ServiceModel

The service contract that is used here employees a request-reply message exchange pattern by default that is not explicitly specified. You can specify this and other message exchange patterns for client-service communications by setting properties of the OperationContractAttribute and ServiceContractAttribute in the contract.
[sourcecode language=”csharp”]
namespace WCFService
public interface ICalculator
// It will be exposed to clients
double Add(double number1, double number2);
Step 2 : Implement a Windows Communication Foundation Service Contract : Implement the Service Contract defined in step1.
[sourcecode language=”csharp”]
namespace WCFService
public class CalculatorService : ICalculator
#region ICalculator Members
public double Add(double number1, double number2)
Console.WriteLine("Service called at : {0}", DateTime.Now.ToString());
Console.WriteLine(@"Calculator Service got called
with two parameters {0} and {1}",
double result = number1 + number2;
Console.WriteLine("The result is : {0}",result);
return result;
Step 3 : Run a Basic Windows Communication Foundation Service :
This topic describes how to run a basic Windows Communication Foundation (WCF) service. This procedure consists of the following steps:

  • Create a base address for the service.
  •  Create a service host for the service.
  •  Enable metadata exchange.
  •  Open the service host.

[sourcecode language=”csharp”]
namespace WCFService
class Program
static void Main(string[] args)
// Address
Uri baseAddress =
new Uri("http://localhost:8080/WCFService/Service");
// Host
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService),
// Binding, Contract
new WSHttpBinding(),
// Metadatabehavior
// WSDL information we need to expose to clients
// it works on HTTP GET Method
ServiceMetadataBehavior serviceMetadatabehavior
= new ServiceMetadataBehavior();
serviceMetadatabehavior.HttpGetEnabled = true;
// Start the service
Console.WriteLine("Service started : {0}",
// Stop the service
Console.WriteLine("Press ENTER to shut down the service");
Console.WriteLine(@"Service shutdown successfully.
Thank you for using our service!");
catch (CommunicationException ce)
Step 4: Create a Windows Communication Foundation Client : This topic describes how to retrieve metadata from a WCF service and use it to create a proxy that can access the service. This task is most easily completed by using the ServiceModel Metadata Utility Tool (Svcutil.exe) provided by WCF. This tool obtains the metadata from the service and generates a managed source code file for a client proxy in the language you have chosen. In addition to creating the client proxy, the tool also creates the configuration file for the client that enables the client application to connect to the service at one of its endpoints.

svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config

By default, the client proxy code is generated in a file named after the service (in this case, for example, CalculatorService.cs or CalculatorService.vb where the extension is appropriate to the programming language: .vb for Visual Basic or .cs for C#). The /out switch used changes the name of the client proxy file to “generatedProxy.cs”. The /config switch used changes the name of the client configuration file from the default “output.config” to “app.config”.

Just a note : If you would like to test your service quickly. You can use WCFTestClient.exe utility which will help you to test your service without writing a single line of code for your WCF Client!

Step 5: Configure a Basic Windows Communication Foundation Client : This topic adds the client configuration file that was generated using the Service Model Metadata Utility (Svcutil.exe) to the client project and explicates the contents of the client configuration elements. Configuring the client consists of specifying the endpoint that the client uses to access the service. An endpoint has an address, a binding and a contract, and each of these must be specified in the process of configuring the client.
svcutil.exe will provide you the default configuration automatically.
Step 6 : Use a Windows Communication Foundation Client : Once a Windows Communication Foundation (WCF) proxy has been created and configured, a client instance can be created and the client application can be compiled and used to communicate with the WCF service. This topic describes procedures for creating and using a WCF client. This procedure does three things: creates a WCF client, calls the service operations from the generated proxy, and closes the client once the operation call is completed.
Now, copy paste the svcutil generated files (CS and Config file) within your console project and then you can call your service from your client application as shown below:
[sourcecode language=”csharp”]
namespace WCFClient
class Program
static void Main(string[] args)
CalculatorClient calculatorClient = new CalculatorClient();
Console.WriteLine("Proxy calling service…");
Console.WriteLine(calculatorClient.Add(10, 20));
// Good practice
And then first start your service (your service must be in running state before you run the client) and then run the client. And this is how it will look like:


Mike Taulty’s Video : Windows Communication Foundation:” Hello World”:
Stay tuned for next story! (Just a note : If you would like to get email update whenever new story get posted, please do subscribe using subscription form — given right side) 🙂
Happy WCF Programming! 🙂