Originally posted by Jyothy kidambhi:
Hi All,
To explain all the concepts of OOPs princples, can any one suggest an example ( to a computer science student).
Other than the humble PIE , there are lot more to OOPS like abstraction, service definition(interfaces), object interaction etc... which cant be defined in a single example.
I think some thing like Car or Animal can be used as an example to explain all the three princples of OOPs concepts.
i would strogly suggest that giving an example of real time will lead them to the wrong way of thinking inheritance,IMHO. try to start with an existing concept like a stack, analyze the issues with procedural design and build on that to an object. just saying A is B, A is composed of A1,A2 etc... is not a big deal but knowing how to make "objects interact" is the essence and abstracting the concept in the object is the real one.