Professional Documents
Culture Documents
Object-Oriented Principles
Object
Abstract representation of something in the real world Group of objects with the same structure and properties Object that belongs to a specific class Specifies that when you create a new object, it inherits its structure and properties from its class
2
Class
Class instance
Inheritance
Subclasses
Classes that have similar properties and structure of their parent class Subclasses have specializations, which are properties that make them different than their parent class
Property Classes
Top-level Form Builder objects that specify a collection of properties with specific values Property classes can be associated with Form Builder objects to define object properties
5
Approaches:
Create the property class based on an existing object Explicitly create the property class object, and then define its properties and associated values
Create the object and configure its properties as desired In the object s Property Palette, select the desired properties and then click the Property Class button on the toolbar to create the property class
Create the property class object in the Object Navigator and open its Property Palette To add a property, click the Add Property button To remove a property, select the property and then click the Remove Property button
8
When you apply a property class to a form object, the form object is subclassed to the property class To subclass a form object, open the object s Property Palette, and the the property class name in the Subclass Information dialog box
9
Select whether you are subclassing from an object or a property class Select the property class name
The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.
10
Object Groups
Top-level form objects that contain groups of objects that can be reused in different forms Examples of object types in object groups:
Object groups are created in a source from, and then subclassed into target forms
11
Create a new object group object in the form template Rename the object group
12
Create the objects Drag and drop the objects on the object group Object Group Children node
13
Select the object group in the source form Drag the object group to the Object Groups node in the target form, drop the object group, and click the Subclass button
14
When you subclass an object, changes to original object are propagated to subclassed objects When you copy an object, changes to original object do not affect subclassed objects
15
Subclassed objects
16
Object Libraries
Top-level Form Builder objects that are independent of specific forms Contain form objects that can be referenced in specific forms
17
Create a new object library object in Form Builder Save the object library file
18
19
To create a new tab page, select the Library Tabs node, and then click the Create button Right-click the new tab page, and then click Property Palette to open the tab page Property Palette Change the tab page Name and Label values
20
Double-click the object library icon to open the Object Library window
21
Create and configure the object in a source form Open the source form Object Navigator and the Object Library window side-by-side
Maximize the Object Navigator window Open the Object Library window, and then click the Restore button so the Object Library appears in a window Reposition the windows as necessary
Drag and drop the object onto the Library Tab page
22
23
Open the target form Object Navigator and the Object Library window side-byside Drag and drop the object library object into the target form Subclass the object into the target form
24
SmartClasses
Object library objects that are defined as standard object types for an application SmartClassed objects appear as selections on a pop-up menu when you create a new object and then right-click the object Speeds up the process of using object libraries
25
Creating a SmartClass
Select the object in the object library Click Object on the menu bar, and then click SmartClass
26
Selecting a SmartClass
27
PL/SQL Libraries
Library of PL/SQL named program units that can be used in forms Top-level Form Builder object that is not associated with a specific form Specific program units can be attached to forms
Code is not part of form .fmb file Code is only loaded when program unit is called
28
Select the PL/SQL Libraries node, and then click the Create button Save the library in the file system
Library name is the same as the filename File has a .pll extension
29
In general, PL/SQL library files should be saved in the default PL/SQL library folder
Path: Developer_Home\TOOLS\OPEN60
If you save a library file in a different location, that path and file must always be available when you open forms that reference the library
30
Select the library Program Units node, and then click the Create button Select the named program unit type (procedure, function, package) Type the program unit code in the PL/SQL Editor window
31
Attach the library to the form Call the library program units from form triggers
32
Select the form s Attached Libraries node, and then click the Create button Navigate to the library file and attach the file
If the library is saved in the default library folder, click Yes to discard path information If the library is not saved in the default library folder, click No to save path information
33
Reference the program unit and pass the required parameters as specified in the attached library specification in the Object Navigator
34
Calendar Windows
Associated with a form text item that displays date values Allows the user to select a date The selected date value is returned to the form text item
35
Open the STNDRD20.OLB object library and copy or subclass the Calendar object group into the form Attach the CALENDAR.PLL PL/SQL library to the form Create a trigger associated with the form text item that calls a procedure in the CALENDAR.PLL PL/SQL library
36
Open the target form Open the STNDRD20.OLB object library Subclass the CALENDAR object group into the target form
37
38
Create a new attached library object in the target form Click Browser, select CALENDAR.PLL, click Open, and then click Attach to attach the library
39
Create a Show Calendar button next to the date text item Create the trigger to call the GET_DATE procedure in the DATE_LOV package
40
41
Flexible Code
Use system variables to retrieve and set system values Use built-in subprograms that dynamically retrieve and set form object properties
42
GET_ built-ins
Allow you to retrieve current object properties Allow you to dynamically set object properties
SET_ built-ins
43
GET_APPLICATION_PROPERTY Built-in
GET_APPLICATION_PROPERTY(property_name);
44
Syntax:
45
Syntax:
return_value := FIND_object(object_name);
46
Syntax:
47
Direct referencing
Directly referencing a form object using the format :block_name.object_name Specifying block and item names in single quotation marks Allows you to reference objects that are not in the current form
48
Indirect referencing
COPY
Syntax:
Value: desired value Destination: form item
Format: block_name.item_name
COPY(value, destination);
49
NAME_IN
Syntax:
Return_value: retrieved value
Is always a character string
return_value := NAME_IN(source);