CSC/ECE 517 Fall 2011/ch6 6b ra: Difference between revisions
No edit summary |
|||
Line 4: | Line 4: | ||
=='''Introduction'''== | =='''Introduction'''== | ||
<p> Subclassing is one of the significant features of [http://en.wikipedia.org/wiki/Object-oriented_programming OO programming], which greatly increases the reusability of classes and also minimizes duplication of code. A subclass usually inherits some properties from a super class. A superclass consists of common features that can be extended over subclasses. It is extensively used in object oriented programming because of the reusability that can be achieved. Superclass and subclass are commonly called base and derived class. The relationship between a subclass and superclass can be represented by a simple UML diagram as shown below. | <p> Subclassing is one of the significant features of [http://en.wikipedia.org/wiki/Object-oriented_programming OO programming], which greatly increases the reusability of classes and also minimizes duplication of code. A subclass usually inherits some properties from a super class. A superclass consists of common features that can be extended over subclasses. It is extensively used in object oriented programming because of the reusability that can be achieved. Superclass and subclass are commonly called base and derived class. The relationship between a subclass and superclass can be represented by a simple UML diagram as shown below. | ||
[[File: | |||
[[File:UMLwiki2.jpg]] | |||
<br> |--------------------| | <br> |--------------------| | ||
Line 15: | Line 16: | ||
<br> | Sub Class | | <br> | Sub Class | | ||
<br> |-----------------| | <br> |-----------------| | ||
==Conclusion== | ==Conclusion== |
Revision as of 19:01, 12 November 2011
Subclassing
Introduction
Subclassing is one of the significant features of OO programming, which greatly increases the reusability of classes and also minimizes duplication of code. A subclass usually inherits some properties from a super class. A superclass consists of common features that can be extended over subclasses. It is extensively used in object oriented programming because of the reusability that can be achieved. Superclass and subclass are commonly called base and derived class. The relationship between a subclass and superclass can be represented by a simple UML diagram as shown below.
|--------------------|
| Super Class |
|--------------------|
/|\
|
|
|-----------------|
| Sub Class |
|-----------------|