Saturday, November 8, 2014

Basic elements of Object oriented programming(OOPS)

Classes- It’s like a container and contain the member variables and member functions. E.g. if you say the house is the class and it contains Fridge, Washing Machine, Fan all this are Member variables or attributes of class.


Object It’s the instance of class, its just interface which will access the member variable and Member function of the class. E.g. If house is the Classes and Items in House in member Variables or attribute then the person who is living in the house in Instance for Classes.


Constructors - It’s used to initialize the object.  e.g.  Like in above if House is Class and Fridge, WM and Fan is Attributes and House Members are Object then when we initialize the object then we intialize the attributes like fridge, WM to initiate or initialize.


Inheritance – Process of getting the base class functionality into derived classes. E.g. there is House H1 and another house H2. He is owner of H1 and His father is owner of H2, now this member is able to access both the house.


Abstraction – Is the process of hiding the implementation from outside world. E.g. Hiding the way of Cooking in your home.


Polymorphism Poly means “many” and morphism means “forms”. One things is using in many forms.  E.g. Your home dining table use for having food, and for reading table also.  It is basically Over Loading and Over riding.



Encapsulation Process of Hiding the data members or Members variables from outside words and limited the access for it. E.g. Only house members are allow to access dressing table not out siders.

Monday, November 3, 2014

what is OOPS?

OOPs – Object Oriented Programmings, It is the way to solve the programmings problem in the structured way.


[ In software world we face many problems and if you co-related all this problems to real life it is exact same as our day to day problems. So, in Rest of the article we will describe how the OOPs are related to real life. ]


OOPs are organized around “Object” instead of the action. “Object” which is mainly instance of the “Classes” and they interact with others to design the application.

[In real life if you will see suppose Vehicles, Head Light is the object of Class type Car.  Bulb, Chair are the object of Room. ]




Mainly the 1st OOPs steps is to identify the Object and put them into the common type and then find how they make relation with other. Like we have two things TV and Fridge, So for TV we cannot include the compressor entity  in Class and Screen in Fridge; So it defined as TV as class and Screen, Power cable, Register as type. Fridge compressor,  Light, Power Cable





If you see above we need to create the two different class as both of the class is consist of different behavior. Now  in this two class “Power Cable” is common in both of the classes so why not we create the another class and create entity for Powers. Power is class and Cable, Chords.




If you see above bringing all the common types into one umbrella it’s the main concepts of OOPs to bring all the classes and their entity together and work with the objects of that type. This Called as Inheritance in the OOPs[That we discuss later].


Main concepts and rules in OOPs are;

1.       Object and Classes, defined the common types into one class and create the instance of the classes is called as objects.

2.       Classes are defined into main classes and Sub classes and Share the common behaviour with each other this is called Inheritance.

3.       Same type methods are behaving differently based on their specification like Mobile use for Call and receive call and we can use as watch and timer also. Is called as Polymorphism in OOPs,


4.       Explain the behaviour only but don’t expose how it is behaving , like Car wheel is rotating(running) but how it is not exposing to others this is Abstraction in OOPs.

To get the Basic Elements of OOPs Please click on Below Links

http://oopsconceptss.blogspot.in/2014/11/basic-elements-of-object-oriented.html

www.getmscode.com