Completed 6 years in Software Industry

image

 

24th March is very important date in my life. I started my journey as professional or in simple words I started working on 24th March 2008 after passing engineering in June 2007. Hence today I have completed 6 years as working professional. This has been an exciting journey. In these 6 years, I worked on various projects, under different managers, in three different companies in three different cities. When I look back, I find myself different than what I was on 24th March 2008. I must say this journey has changed me lot.

I have worked for these three companies so far,

image

On 24th March 2008 I joined UST Global as trainee Software Engineer and worked there till September 2010.

On 10th October 2010 joined Infosys as Senior System Engineer and worked there till June 2012.

On 2nd July 2012 joined Telerik as Developer Advocate and since then working here.

If you are reading this post then you must be knowing that I love to share my learning via my blog. I love blogging and I am sure you also (in case if you) love me for my blog and articles. In last 6 years my journey of blogging is as below,

 

image

 

Clearly seeing above chart you can conclude that I am getting old and momentum of writing posts are getting reduced. Oh God! Help me! I promise to meet your expectation and product quality posts in regular interval.

Whenever I get opportunity I speak in conferences, user groups, colleges. In these 6 years I have delivered around 50 sessions.

image

In these six years, I have been awarded as Microsoft MVP 4th times, C# Corner MVP 4th times and Telerik MVP 1 time.

 

image

would take this opportunity to thank each one of you for your support in my journey. In coming years I will focus on Cloud, Node.js, JavaScript and other technologies.

About these ads

Single Responsibility Principle in C-Sharp: Simplified

Let us start with understanding what is SRP?

Single Responsibility Principle says every class should have single responsibility and all the responsibility should be encapsulated in the class. To explain it further assume you are creating a creating class to Calculate Salary.

Now if you have two methods in class like below. Usually we can think of these two methods in a Salary class.

  1. CalculateSalaray
  2. PrintSalary

So you can say there are two responsibilities to class. With two responsibilities Salary class can be defined as below,

 class Salary

{
 public double wageperday { get; set; }
 public int attendence { get; set; }
 public double CalculateSalaray()
 {
 return this.wageperday * this.attendence;

}

public void PrintSalaray()
 {
 Console.WriteLine(this.wageperday * this.attendence);

}

}


As of Martin SRP means, “Class should have a single reason to change”. Reason to change can be seen as a Responsibility. On seeing closely you will find above class has two reasons to change,

  1. When formula for calculate salary is changing
  2. When print logic is changing

Since Salary class has two responsibility so there are two reasons to change it. We can say Salary class is not following Single Repository Principle.

We can summarize that

image

Next we need to find that how could we divide two responsibility in two separate class. So above Salary class can be divided into two separate classes. One class to CalculateSalary and another to PrintSalary.

Below is the class CalculateSalary. This class got only one responsibility to calculate salary.

class CalculateSalary
 {
 public double wageperday { get; set; }
 public int attendence { get; set; }
 public double CalculateSalaray()
 {
 return this.wageperday * this.attendence;

}
 }

 

Another class is PrintSalary. This class also got only one responsibility to print salary.

 class PrintSalary
 {

public void PrintSalaray(double salary)
 {
 Console.WriteLine(salary);

}
 }

Let us understand what we done now is divided Salary class in two separate classes. Salary class had two responsibilities and two reasons to change. Now we have created two classes respectively for CalculateSalary and PrintSalary.

image

Now at client these two classes can be used as below,

static void Main(string[] args)
 {
 CalculateSalary clcObject = new CalculateSalary();
 clcObject.wageperday = 300;
 clcObject.attendence = 20;
 var salary = clcObject.CalculateSalaray();
 PrintSalary prntObject = new PrintSalary();
 prntObject.PrintSalaray(salary);
 Console.ReadKey(true);

}

As of now you should have idea about Single Responsibility Principle. To summarize Single Responsibility Principle says a class should have single responsibility and only one reason to change. I hope you find this post useful. Thanks for reading.

You love us now please vote for Telerik Products in GIDS 2013

image

I am very happy and excited to share with you that Telerik Products have been nominated in different categories in GIDS 2013 . We have been nominated in 7 different categories.

Vote Here

Telerik Products are nominated as follows, Please browse to question numbers as given below tp vote for your beloved Telerik Products. Navigate here to vote

Telerik TeamPulse is nominated under Collaboration Solution category. To vote for this select this option in Question number 2.

clip_image001

Telerik Sitefinity CMS is registered under Content Management category. To vote for this select this option in Question number 3.

 

clip_image003

Telerik TeamPulse is nominated under Change and Configuration Management category. To vote for this select this option in Question number 5.

clip_image005

Telerik TestStudio is nominated under Testing category. To vote for this select this option in Question number 6.

clip_image006

Telerik KendoUI is nominated under Web Development category. To vote for this select this option in Question number 8.

clip_image007

Telerik Icenium is nominated under Mobile Development category. To vote for this select this option in Question number 9.

clip_image009

Telerik Devcraft is nominated under Framework category. To vote for this select this option in Question number 10.

clip_image010

Your love and support will help us to build better products. Take few minutes out and Navigate here to vote.

We are committed to help you in “Delivering More Than Expected “. You may have further query feel free to reach me at dhananjay.kumar@telerik.com