10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5: Working with ClassesThis section contains the following topics:Conceptual Background (see page 113)How You Can Reference Objects (see page 114)Using an Object-oriented Approach to <strong>Programming</strong> (see page 120)Inheritance (see page 121)How You Can Create a User Class (see page 127)External Classes (see page 135)How You Can Create Fields from User Classes (see page 139)How You Can Manipulate Objects Generically: Casting (see page 139)Overview of the OpenROAD System Classes (see page 142)This chapter explains the concept of classes in OpenROAD and describes howsystem, external, and user classes make an object-oriented approach toprogramming possible. The detailed information in this chapter about creatinguser classes supplements the description of creating a user class provided inthe User <strong>Guide</strong>.Conceptual BackgroundAll application components are objects that are created using the OpenROADsystem classes. For example, a frame is an object of the FrameExec systemclass, and a button field is an object of the ButtonField system class.The class of an object defines the attributes you can read and set for thatobject. For example, the ButtonField class includes a BitmapLabel attributethat lets you specify an image as the button's label. For more informationabout how to read and set these attributes, see How You Can Set and GetAttributes (see page 117).The class of an object also defines the methods that you can invoke tomanipulate the object. For example, the EntryField class includes a MarkAllTextmethod that you can use to highlight the text in an entry field. For moreinformation about how to invoke a method on an object, see How You CanInvoke Methods (see page 119).Following an object-oriented model, the OpenROAD system classes use aninheritance hierarchy in which each subclass inherits the attributes andmethods defined for all its superclasses. When you create your own userclasses, you can structure them into an inheritance hierarchy. For moreinformation about class hierarchies, see Inheritance (see page 121).Working with Classes 113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!