Basic Concepts of OAF (Oracle Applications FrameWork )

OAF stands for Oracle Applications Framework. This particular technology will be used to  develop Application pages , all pages will be of Web base. In Previous versions of Oracle Ebiz , Oracle Forms has been widely used to develop transactions forms , but due to its heavy nature & Time consuming Performance ,it becomes very  difficult to carry out Business operations. To improve the Performance , Oracle has introduced OAF.

Oracle Application Framework (OAF) is an architecture for creating web based pages with in Oracle EBS platform.  OAF functionality can be achieved using JDEVELOPER Tool.


OAF follows MVC architecute.

MVC stands for Module View Controller Architecture 

Schematic representation of MVC Architecture 





Model (bc4j Component)
Model contains the BC4J Components or objects which handles data directly from Database. It Includes Business Components for Java (BC4J Objects) which mainly are:
• Entity Object

• View Object

• Application Module

•Associations

•View link

Each of the BC4J component has been explained in detailed manner , Refer below.

1.Entity Objects

Entity Objects are generally based on one table or view  which encapsulate the business rules.

 These objects are used by OAF page to perform update/insert/delete operations. You can join two EOs using Entity Associations.

 Any Table Object  which subjected to be used as Entity Objects ,then that object must 5 Mandatory WHO columns. With out those columns ,Table object cannot be used as Entity Object.

Below are the Mandatory WHO columns which requires to define a Entity Object
  1. LAST_UPDATE_DATE        
  2. LAST_UPDATED_BY         
  3. CREATION_DATE             
  4. CREATED_BY                   
  5. LAST_UPDATE_LOGIN 


After creating the entity object always attach that to VO.

When ever any Entity objects gets created and at the same time with that Entity Object name  a java class will also get created by extending OAEntityImpl  class.

All the Entity Objects that you create are subclass of 

oracle.apps.fnd.framework.server.OAEntityImpl" class


OAEntityImpl is a seeded Interface class which have methods like
  • setCreationDate
  • setCreatedBy
  • setLastUpdateDate
  • setLastUpdatedBy
  • setLastUpdateLogin

2.View Object 


These objects contain a SQL query that queries the data from database and present it in the OAF page.
  View Objects can be created in two ways.
         i) Based on EO
        ii) Individual VO



VO based EO : Whenever EO created , it should need to be attached to View Object. Through view object only we can display selected columns of EO and can also perform DML operations on EO objects.
Individual  VO: Individual VO will have simple queries or Complex queries. Just need to write the query in the SQL Statement Section. If multiple VO’s used and need to be interlinked then that can be done through VIEW LINK.


Whenever any View Objects gets created along with it one  XML file and two Java classes also gets created by extending interfaces namely OAViewRowImpl  & OAViewObjectImpl.

  • XML FILE 



 it consists of query and if u open the XXVO.xml you can find out the query and what are the transient attributes involved if there is any.

OAViewRowImpl

  • Provides access to a view object row. The view object row can refer one or more entity object's rows in addition to derived attributes such as calculated columns.
  •  It is like a cursor and used to catch the particular record or row by row
  • When ever you want the transactions record by record use this RowImpl file


OAViewObjectImpl

 Accesses the result set of a SQL statement. A view object is a business component that encapsulates SQL code and metadata that maps columns in the select statement to the attributes of one or more entity objects. A view object use SQL to join, filter or sort business data or to shape it for presentation. View objects provide row sets that can be viewed or used to update the underlying entity objects 

The main purpose is to modify the query at runtime and execution can also be done in class file.

This is the base class file, what ever operations related to query like adding where conditions and passing can be done using this class file.


3.Application Module

it is heart of component with out this we can’t do anything, it creates new data base session for each and every run. With out the data base session we can’t run the page. We can perform business validation and logic in application module. It access view objects .

   When you create Am with name Sample AM it creates 2 files

i) Xml Files – SampleAm.xml

This XML files are responsible for running  and creating the session

ii) Java File – SampleAmimpl.java

Java file will be created by extending the interface OAApplicationModuleImpl . it is heart of   AM. When ever you create VO and if u wants to access that VO then we need to attach VO to this AM.

3.Association

·         It is a join between entity objects (To delete a record which has master detail relation ship using association we can delete)
·         It create only XML File


3.View Link

·         It is the join between View objects and the purpose is to extend the Master table and it creates only XML File.


View

It represents the View layer of the MVC architecture, Which Consists of two components

 Page :This component will be responsible for Creating Window name and Title name of the page. Every page will be attached to AM and all the pages will be stored in Database.

Region 
It is basically container, which consists items and regions 

Purpose – to make look and feel better to display the page, use region

Region can be created using 2 ways

1 – using wizard – for table

Region – for normal one


Controller 

The navigational flow and caller role is served by the controller objects, it guides the

page rendering for the first time and also guides it based on user interaction on the page. They represents the Controller part of MVC.

Basically its  a java file; we can capture events and actions of a page and directs the application flow. For Example

1. Handle button press and other events
2 .Automatic queries
3. Dynamic WHERE clauses

 The logic for accomplishing all these tasks is written in controller




















Process Request :
This phase is invoked upon a browser ‘Get’ or redirect/forward. This is where custom code can call the application module to initialize and query the data. this phase may optionally construct or modify the web beans to create or alter the page structure and web bean properties. Its same like When New Form Instance in Oracle Forms
Process Form Data:
ProcessFormData is internally used by Oracle and we are never expected to write any code in this method that's why our controller never contains this method. By the name its suggests  that its responsible for fetching the data from the database and put it in respective Entity Cache and VO Cache as and when required.
This METHOD calls for execution of the page and Although it is not visible as it will be maintained by the framework
When u will click on any controller button or any Event , it will call processformdata and next processformrequest and this is order of execution.


Process FormRequest :
 This method is used to execute after the page is loaded. It will handle responses  of all the User related Transactions , like Submitting Button, Cancelling Button and Many more.
To get and set values of the fields, using oapagecontext.getparameter and oapagecontext.putparameter.
For redirecting to the current page or another page, for example to redirecting to current page itself use oapagecontext.forwardimmediatelyToCurrentpage









Comments

Post a Comment

Popular posts from this blog

Sample HZ API's script to Create Contacts and Contact Points in Oracle

REST integration built-in OIC to read Large files with size more than 10MB