Concept : Understanding Inheritance

Page Status: Beta

Back to Concepts and HOW TOs

Contents

[edit] Description 

Like other object oriented systems, Bungee Connect provides inheritance, which includes the benefits of code reuse, specialization, and overriding of fields and functions. Inheritance allows you to create a parent class with various forms, fields and functions. Then create a child or subclass from the parent that is able to make use of the parent classes' members without modification or by overriding the fields or functions of the parent. 

For example, if you create a class Person with fields firstName, lastName and address, and then create a class Employee that inherits or subclasses from Person, then Employee has the same fields (firstName, lastName and address) that Person has. You can also, for example, override the address field so that it is the Employee's work address and add a field department. Employee is able to reuse forms, fields, and functions from Person and can override fields, like address, that might differ for Employee.

[edit] See Also

Application Objects
Function and Field Overrides
Adding a Function or Field Override
Using OnCreate
Inherits From

[edit] Tags

    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.