oracle forms : reusable components

21
Sharing Objects and Code http:// ebiztechnics.blogspot.com

Upload: sekhar-byna

Post on 10-Feb-2017

557 views

Category:

Software


9 download

TRANSCRIPT

Page 1: Oracle Forms : Reusable Components

Sharing Objects and Code

http://ebiztechnics.blogspot.com

Page 2: Oracle Forms : Reusable Components

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

Page 3: Oracle Forms : Reusable Components

Sharing & Reusing Code

• Increases productivity• Decreases maintenance• Increases modularity• Maintains standards

http://ebiztechnics.blogspot.com

Page 4: Oracle Forms : Reusable Components

Property Classes

Canvas

properties

Window

propertiesItem

properties

Alert

properties

LOV

properties

http://ebiztechnics.blogspot.com

Page 5: Oracle Forms : Reusable Components

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

Page 6: Oracle Forms : Reusable Components

Object Group

• Is a logical container• Enables you to:

– Group related objects– Copy multiple objects in one operation

http://ebiztechnics.blogspot.com

Page 7: Oracle Forms : Reusable Components

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

Page 8: Oracle Forms : Reusable Components

Subclassing

Ability to make exactcopy of object

Ability to add to object

Abilityto alterproperties

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

Page 9: Oracle Forms : Reusable Components

Copying Objects

Ability to make exactcopy of object

A/C No:

Branch:

Balance:

A/C No:

Branch:

Balance:

http://ebiztechnics.blogspot.com

Page 10: Oracle Forms : Reusable Components

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 changesTo Parent

http://ebiztechnics.blogspot.com

Page 11: Oracle Forms : Reusable Components

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

Page 12: Oracle Forms : Reusable Components

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

Page 13: Oracle Forms : Reusable Components

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 indicatessmart class

http://ebiztechnics.blogspot.com

Page 14: Oracle Forms : Reusable Components

Working with Smart Classes

1. Select an object in theLayout 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

Page 15: Oracle Forms : Reusable Components

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

Page 16: Oracle Forms : Reusable Components

PL/SQL Libraries

Procedures

Functions

Packages

PL/SQLLibrary

.pll or DatabaseForm Module

Menu ModuleReport ModuleGraphics Module

http://ebiztechnics.blogspot.com

Page 17: Oracle Forms : Reusable Components

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

Page 18: Oracle Forms : Reusable Components

Creating PL/SQL Library

http://ebiztechnics.blogspot.com

Page 19: Oracle Forms : Reusable Components

Attaching PL/SQL Library

http://ebiztechnics.blogspot.com

Page 20: Oracle Forms : Reusable Components

Calling Subprograms

procedure p1( );

...function...

pack1.p2 ( );

Attached Libraries

Database

P1

P2

Calls

http://ebiztechnics.blogspot.com

Page 21: Oracle Forms : Reusable Components

Summary

• Reasons to share objects and code:– Increased productivity– Increased modularity– Decreased maintenance– Maintaining standards

• Property Class• Object Group• Object Library• PL/SQL Library

http://ebiztechnics.blogspot.com