Hi guys.. I always to tend for get the 3 basic properties of OO... Luckly I found an acronym to help me to remember the keywords.. it is PIE P - Polymorphism I - Inheritance E - Encapsulattion You should reverse PIE as IEP so that you get them properties according to importance i.e. Encapsulattion, Inheritance and Polymorphism... Hope it helps other guys who are confused like me
You should reverse PIE as IEP so that you get them properties according to importance i.e. Encapsulattion, Inheritance and Polymorphism
It doesn't make sense to order them by "importance". These properties are orthogonal. One could make an argument that polymorphism is possible because of inheritance, but conceptualy, all three properties characterize different aspects of OO, there is no such thing as more or less important property. Eugene.
Joined: Oct 30, 2000
Hi Eugene, Thanks a lot for your information... i didn't know that... i found them in the same order in several books... Thanks again...
The order you find them in books may also be the order it's easiest to teach them in. As Eugene notes, you can't really have polymorphism without inheritance, so it makes sense that they'd discuss inheritance first. Furthermore you need to have some idea what an instance is before you can understand polymorphism - and learning about encapsulation is a good way to introduce the notion of an instance. As for encapsulation vs. inheritance - I'd expect encapsulation to be taught first, but I suppose it's possible to discuss inheritance first if you're talking about static methods. Seems wierd though. Incidentally, Peter van der Linden's excellent Just Java 2 cites four key OO concepts - including Abstraction - and suggests the mnemonic "A PIE". But he then discusses them in the order Abstraction, Encapsulation, Inheritance, Polymorphism.