Object Oriented Software Engineering View all facts Glossary Help |
subject > programming language construct > class > subclass |
subclass (derived class) | ||||
subject | fact |
subclass | is a synonym of derived class | |
has definition A class that is an extension of another class, and hence inherits from the other class | ||
inherits all instance variables and methods defined in its ancestor classes | ||
is a subtopic of 2.5 - Organizing Classes Into Inheritance Hierarchies | ||
is a kind of class | ||
class | can have instances | |
contains all of the code that relates to its objects including | ||
contains data associated with each object | ||
declares a list of variables, called instance variables, corresponding to data that will be present in each instance | ||
has part class name | ||
has part class variable | ||
has part code | ||
has part constructor | ||
has part instance variable | ||
has part method | ||
has part variables | ||
is an abstract representation of all the instances of that class that may ever exist | ||
is probably useless if it has no responsibilities attached to it | ||
is the unit of data abstraction in an object-oriented program | ||
is divided up into methods | ||
is drawn as a box with the name of the class inside in a UML class diagram | ||
is needed in a domain model if you have to store or manipulate instances of it in order to implement a requirement | ||
represents several similar objects | ||
see also class^2 | ||
should be created to hold a responsibility if the responsibility cannot be attributed to any of the existing classes | ||
should be named after things their instances represent in the real world | ||
should have a comment at the top describing the purpose of the class, how it should be used, its authors and its history of modification | ||
should not be named after the internals of a computer system such as 'Record', 'Table', 'Data', 'Structure', or 'Information' | ||
data abstraction | groups the pieces of data that describe some entity, so that programmers can manipulate that data as a unit | |
helps a programmer to cope with the complexity of data | ||
hides the details of data |
Kinds of subclass :
Next class: superclass Up: class Previous class: singleton^2