My sister called me up yesterday night as she had some doubts about oops that is object oriented programming. It is really amusing, that now she is coming up to me for IT related topic. This is how our conversation goes
Kari: Hey sis
Me: Hi! Long time no call?
Kari: Listen leave all that i really need a favour from you ........could you explain me object oriented
Programming asap
Me: Yeah sure oops is really simple
Kari: OOPS? what is that
Me: you really don’t know anything about it. That is short form for object oriented programming .
Kari: See ...could you help me out please
Me: Okay do you know about data modelling and entities attribute s and all that
Kari: Yeah I know that in fact I found it very interesting
Me: okay oops is quite similar to that.
Kari: oh
Me: In it what you first have is class .. it is collection of similar objects, instances, events
Kari: Is it something like entities
Me: Yeah exactly and in same way it has attributes
Kari: Then it is same as data modelling
Me: Don’t jump to conclusions ...... the difference in oops is that it has methods
Kari: Methods?
Me: They are simply instructions coded ones like in c++ or java that will have an impact on your objects
Kari: But why have them?
Me : See in data modelling rather than having to pass restrictive SQL statements to perform functions why not have methods attached . So rather than limiting yourself to CRUD that is create read update delete operations why not have flexibility in employee class in terms of Recruit Promote Terminate Appraise etc
Kari: Oh now I get it is that it
Me : Nope now you have Inheritance and Polymorphism
Kari: Now what is that?
Me: Inheritance is where you have a parent class and sub class and the sub class inherits the behaviour of the parent class like for example Teachers will also have name age sex and students will also have same attributes.
Kari: And what is Polymorphism
Me: It is when same method gives different result for different classes for example promote for teachers would mean on term of designation and also salary but in terms of student it means standard
Kari: Hope that is it
Me: yupp thats about it
Kari: thanks sis see you later will tell you then what this was all about
Monday, November 17, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment