2. Objectives
• Describe the various methods for reusing objects and code
• Inherit properties from property classes
• Group related objects for reuse
• Reuse objects from an object library
• Reuse PL/SQL code
http://ebiztechnics.blogspot.com
5. Inherit Properties
• Set the Subclass Information property.
• Convert an inherited property to a variant property.
• Convert a variant property to an inherited property.
Inherited Property
Variant Property
http://ebiztechnics.blogspot.com
6. Object Group
• Is a logical container
• Enables you to:
– Group related objects
– Copy multiple objects in one operation
http://ebiztechnics.blogspot.com
7. Using Object Groups
• Blocks include:
– Items
– Item-level triggers
– Block-level triggers
– Relations
• Object groups cannot include other object groups
• Deleting:
– An object group does not affect the objects
– An object affects the object group
http://ebiztechnics.blogspot.com
8. Subclassing
Ability to
make exact
copy of object
Ability to add
to object
Ability
to alter
properties
A/C No:
Branch:
Balance:
A/C Type:
Open Date:
A/C No:
Branch:
Balance:
A/C No:
Branch:
Balance:
A/C No:
Branch:
Balance:
http://ebiztechnics.blogspot.com
9. Copying Objects
Ability to
make exact
copy of object
A/C No:
Branch:
Balance:
A/C No:
Branch:
Balance:
http://ebiztechnics.blogspot.com
10. Inheriting Changes
Ability to
Inherit changes
Ability to
Inherit changes
Ability to
Inherit changes
A/C No:
Branch:
Balance:
A/C Type:
Open Date:
A/C No:
Branch:
Balance:
A/C No:
Branch:
Balance:
A/C No:
Branch:
Balance:
Make changes
To Parent
http://ebiztechnics.blogspot.com
11. An Object Library
• Is a convenient container of objects for reuse
• Simplifies reuse in complex environments
• Supports corporate, project, and personal standards
• Simplifies the sharing of reusable components
• Appear in the Navigator if they are open
• Are used with a simple tabbed interface
• Are saved to .olb file or to database
http://ebiztechnics.blogspot.com
12. Advantages of Object Library
• Simplifies the sharing and reuse of objects
• Provides control and enforcement of standards
• Eliminates the need to maintain multiple referenced forms
http://ebiztechnics.blogspot.com
13. Smart Class
• Is an object in an object
library that is frequently
used as a class
• Can be applied easily and
rapidly to existing objects
• Can be defined in many
object libraries
You can have many
Smart Classes of a given object type.
Note: Green check indicates
smart class
http://ebiztechnics.blogspot.com
14. Working with Smart Classes
1. Select an object in the
Layout Editor or
Navigator.
2. Click Right Mouse Button,
From the pop-up menu,
select Smart Classes.
3. Select a class from the list.
http://ebiztechnics.blogspot.com
15. Reusing PL/SQL
• Triggers:
– Copy and paste text
– Copy and paste within a module
– Copy to or subclass from another module
– Move to an object library
• PL/SQL program units:
– Copy and paste text
– Copy and paste within a module
– Copy to or subclass in another module
– Create a library module
– Move to an object library
http://ebiztechnics.blogspot.com
17. Writing Code for Libraries
• A library is a separate module, holding procedures, functions, and
packages.
• Direct references to bind variables are not allowed.
• Use subprogram parameters for passing bind variables.
• Use functions, where appropriate,
to return values.
http://ebiztechnics.blogspot.com