OAF (Oracle Application Framework)

We need to understand the following concepts before we start OAF:
JSP, Java Beans, JDBC, Different components of Java application, Event handling, Concept of cookies.

JSP — Java Servlet Page is a Java program that compiles and generates a class file called ‘Servlet’.
Java Servlet — A servlet is a small Java program that runs within a web server.
Features of Java Servlet:
1. Receives and responds to requests from web clients
2. Functions without a specific protocol (A protocol is a set of rules determining the format and transmission of data)
3. Multi-threaded – a single object can service multiple clients

Servlets job is to serve. It takes the request from client, figure out the data passed by the client, perform processing and send back the response.

Tool: JDeveloper 10G (R12.1.3 Version)
Language: Core Java
Application Server: Apache (R1213) and Weblogic (R1224)

MVC Architecture:
Model — Business Logic — This layer is implemented using technology/ library called BC4J (Business Component for Java) — We have three modules — 1) AM (Application Module) 2) VO (View Object) 3) EO (Entity Object)
View — UI (User Interface) — This layer is implemented using technology/ library called UIX (User Interface for XML)
Controller — Handling Events (ButtonEvent, Click..etc) — This layer is implemented using API called OAControllerImpl (OAControllerImplementation)


MVC Architecture is used in OAF, ADF (Application Development Framework), SOA/BPEL, AndroidMobile, PHP, .NET, Springs, Hibernate

JDev Software consists:
jdevbin: It contains Binary files and API’s
jdevdoc: It contains documentation about OAF libraries
jdevhome: It contains information about source directory

In JDeveloper we have to:
1. Create a DB connection (with APPS schema)
2. Get the DBC file from $FND_SECURE_TOP

JDev Hierarchy:
Workspace >> Project >> Package/ Files

Package Structure:

[<clientname>].oracle.apps.[<valid_top_name>].server –> AM/ VO/ VL
[<clientname>].oracle.apps.[<valid_top_name>].webui –> PG(Pages)/ RN(Region)/ CO
[<clientname>].oracle.apps.[<valid_top_name>].schema.server –> EO
[<clientname>].oracle.apps.[<valid_top_name>].lov.server –> LOV (List of Values)
[<clientname>].oracle.apps.[<valid_top_name>].poplist.server –> Poplist

1. Introduction to Oracle Application Framework(OAF)
• Oracle Application Framework introduced to achieve Abstraction in application design based on early web standards and technologies
• OAF is an advanced technology to implement Oracle E-Business suite with less complexity and more flexibility through abstraction and Reusability of components
• This Technology is completely based on Object Oriented Programming and XML J2EE based data.
• Tools available IDE to develop OAF components are
a. Oracle 9i JDeveloper with OA extension
b. Oracle 10g JDeveloper with OA extension

• OAF is meant for SELF-SERVICE purpose to build presentation layer, addition of business logic and controlling the application flow by easy and user friendly process. OAF is user friendly, with least complexity during development and realistic in functionality.
Client Server Architecture:
Let’s see the basic functionality of a client server architecture before we go into OAF, As OAF works based on three tier architecture Using HTTP Requests, JavaBeans and Java Server Pages.

A client can request for information processing either getting information or setting/updating information from database or into database respectively. To achieve this HTTP Requests take up the responsibility to get or set information using GETTER and SETTER methods.
Java Server Pages(JSP) are Servlets which reside at Application tier whose responsibility is to collect clients request then process request using business logic and generate response to the requests in HTML form as it is web based application.
Java Beans are Reusable components of java which can be manipulated visually using tools, these are generally constructors or methods. Constructors to work without human intervention and method can be guided to function as per requirement.
Java Beans are generally Getter and setter methods of Java to Get/Retrieve fata from database or Set/update data into database through View attributes.
NOTE: These java classes will be generated automatically at the time of View Object and Entity Object Creation because which OAF is called simple and least complex in nature and also developer friendly tool.
OAF makes abstraction between client and server code through three tier architecture which also provides another advantage of reusability and improved performance.
OAF makes it possible to use server code with different clients.
• OAF technology is based on three tier MVC Architecture to achieve abstraction and reusability.

Its simple with three tier architecture with client, middle tier and database tier. Different components of OAF architecture are
 Browser: end users view point
 Web Listener: server component to handle client requests get/set etc.
 Servlet Engine: It handles the implementation of business logic and generation of response to client.
 UIX: component for representing information to client
 Meta Data Repository: It’s a location to store files other than server files. For example an OAF page definition which will be loaded into application server whenever required. Hence AM,VO,EO(BC4J)reside in SERVER folder where as Page definition and controllers reside in the WEBUI folder of an application during Deployment to segregate them and store. SERVER folder is stored in JAVA_TOP where as WEBUI folder is stored at APPL_TOP file directory.
 AOL/J: server component for authentication to access application.
 BC4J: Business Components For Java (AM,VO,EO)
 DATA: data in Database.

Oracle MVC Architecture:
a. Oracle Application Framework works based on Model-View-Controller(MVC) architecture to achieve abstraction and reusability of business components. It’s a three-tier Architecture with Client Tier, Middle/Application Sever Tier and Database Tier.
b. Three tier is a client-server architecture in which user Interface, business logic and data storage are developed and maintained independently. Before getting into deep let us know a few things related to MVC
c. BC4j Components are basically Entity Object (EO), View Object (VO) and Application Module (AM).
d. EO is related to database Tables to retrieve or populate or update data.
e. VO are the user visual component related to EO. An SQL Query to retrieve filtered attributes from entity Objects. A Sql query directly can be written without EO buts it is not recommended always as it not a best practice unless it’s required.
f. A View Object can have many Entity Objects to meet business requirements.
g. An Application Module is a compact pack representing View Objects and Entity Objects under corresponding View Objects which handles transactions and client interactions, JDBC Connection to achieve data changes in the database.
h. BC4J components are EO, VO, AM and related components like view link VL, Entity Association Object AO etc…

MODEL: Model is responsible for business logic execution and BC4J components connect to Database to achieve requirements.
VIEW: View is how application represent itself to Client.
CONTROLLER: It’s the heart area to handle User Interactions and direct the flow in the application. It has two methods Process Request and Process Form request which are responsible to handle user actions like button clicks or navigations or user actions on page and many more.
 MODEL encapsulates the business logic and data
 CONTROLLER directs the flow in the application
 VIEW presents the information to Client/user

Controllers – OA Controller Java Classes
Model – BC4J components (EO, VO, AM, VL, AO)
View – UIX Components (OAF Pages, regions, Items)
In Detail and simple the XML page definition forms the VIEW, Java based controller forms the CONTROLLERS and the Application Module (AM) along with the View Object (VO) and Entity Object (EO) forms the MODEL of an MVC architecture.
Integration of BC4J and UIX is simply OAF, OAF integrate the business logic and the view to provide abstraction.