ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Coding Horror
The scary show for Programmers
Based on True stories from the desk of
software programmers
Inheritance
Episode #1
About the dumbledores
Syed Mansoor Ahmed
(Project Manager)
- Proud Wiproite from last
10 Yrs
- Leads AppC Automation
team
syedmansoor.ahamed@wipro.co
m
Ankit Kashyap
(Analyst Programmer)
- Proud Wiproite from last
5.9 Yrs
- Works as developer;
take care of AppC tools
ankit.kashyap@wipro.com
Why We need it?
Open Close Principle
¡°software entities (classes, modules, functions,
etc.) should be open for extension, but closed for
modification¡±
-from Wikipedia
We all know Inheritance! Yay!!
Let¡¯s check it!!!
Time for hands-on¡­
Car is a
vehicle! So
sweet!!
Back to geometry classes!!
Rectangle Square
Square is a
Rectangle
Awww! Cute ducks need software¡­
And here darkness ends!!
*Shameless copy from some site
Under the tree! Like Budhha
? Are constructors and destructors inherited ?
? How do you prevent a class from being inherited ?
? Can you mark method as sealed ?
? what do you mean by upcasting and downcasting ?
References¡­
? http://en.wikipedia.org/wiki/Inheritance_%28object-oriented_programming%29
? http://stackoverflow.com/questions/4428725/can-you-explain-liskov-
substitution-principle-with-a-good-c-sharp-example
? http://en.wikipedia.org/wiki/Liskov_substitution_principle

More Related Content

C# basics training (Inheritance)