␡
- The Class Hierarchy
- Creating a New Class
- Declaration and Instantiation
- Constructors and Destructors
- Garbage Collection
- Inheritance
- Object Operators
- Adding and Overriding Methods
- Calling the Overridden Method
- Overloading
- Casting
- Oddities
- Encapsulation
- Access Scope: Public, Private, Protected
- Setting Properties with Methods
- Default and Optional Parameters
- Declaring Variables Static and Const
- Revisiting the StringParser Module
- Example: Creating a Properties Class
- Data-Oriented Classes and Visual Basic Data Types
- Advanced Techniques
This chapter is from the book
Calling the Overridden Method
Normally, when you override a method, you want the new method to replace the overridden method, but there are also times when you want the new method to merely add a few steps to the parent method. You can do this by calling "super" on the method.
When deciding which method to call, REALbasic starts at the lowest level of the class hierarchy and looks to see whether the method is implemented there. If it is not, REALbasic checks the parent class, and so on, until it finds an implementation of the method. Because of this approach, as soon as it finds an implementation of the method, it stops looking and never touches any implementation further up the hierarchy.