Object Oriented Programming

A security capsule can save your program’s life (Part.3)

So, let me show how easy it is to implement encapsulation in C#. I will start from the very old fashion to create a encapsulated field then will show the easiest way. Basically to encapsulate a field level variable we would simply declare a setter and a getter method. With the help of the setter method we would set a value for our field level variable and with the getter method we would extract the value from our field level variable set by the setter method. So open the project…

Keep reading

A security capsule can save your program’s life (Part.2)

In the previous post we have created an application. But there was a little bug in our program. Let’s find the bug. How about we run the program once again? And this time we provide the TextBoxes with some information and uncheck the Private CheckBox to see the mobile number of the user and click submit. Oops!!! It is still “N/A” in the ListView’s mobile column but it was not what we expected, Right!!! Cause we unchecked the Private CheckBox in the form. So what was the…

Keep reading

A security capsule can save your program’s life (Part.1)

We are now familiar with the definition of encapsulation but we yet don’t know how to implement it in our code to prevent any kind of Misuse and Bugs in our code. Let me give an example. I think everyone knows what Facebook is. In Facebook, when we create an account we provide different kind of information, so that another Facebook user can know a little bit about us before connecting with us. When a user successfully creates an account, Facebook community hides your phone number (one of additional…

Keep reading

Let’s eat some PIE…!!!

So we have reached to a point where you guys need to know the three principles of object oriented programming. These are Encapsulation, Polymorphism and Inheritance and also called (PIE). In this post I’m going to give some little description about these three principles. I’ll provide more details about them with coding examples in later posts. Encapsulation Using encapsulation in our code we can keep safe our code and data from outside interference and misuse. This is the most important principle of all. We can prevent ourselves from…

Keep reading