您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Content Index

Content Page # 13

Inheritance and polymorphism

The definition of a class of objects can be a specialisation of some existing class of objects – i.e. the new, more specific class of objects can inherit attributes and operations from its (parent) superclass.

Associated with inheritance is the idea of polymorphism by which is objects of different classes can receive the same message that represents different behaviour. Such a feature of a system allows great flexibility, since new behaviour can be easily added to a system at a later date, with much of the existing system requiring no changes. Also new types of objects can be added to a system. (See additional material in Extend section if you want to know more.)

Among the virtues of object technology is the possibility of maximising continuity between that part of the real world a computer system is simulating, an analysis model of it, a design model, and implementation. With such continuity, one increases the chance of systems being correct (i.e. able to do what they were intended to do). The communication between various specialists involved, from domain expert to programmer is also increased. The actual level of software reuse is often less that one might hope for, but there is no doubt that it is important to develop a vast and growing class library to reuse or specialise. Most cases where software can be reused is through the development of more specialised forms of existing objects – i.e. existing objects are extended (specialised).

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg