Getting started with OAF

What is Framework?

A Framework is basically a conceptual platform for developing new software applications. Framework is nothing but a collection of pre-built APIs and libraries, Packages which can be reused/ extended to make the development easy for a particular technology. Besides APIs. Framework might come with IDE, plugins for interacting with System/ Network Software etc. So to conclude it provides the foundation to build an quality, flexible, extensible and robust application by streamlining the development process and make the development easy.

Some examples of Framework can be:

  1. Magento, Yii, Cake PHP for PHP.
  2. Spring/Hibernate, Struts, ADF for J2EE.
  3. Sliverlight, Visual Studio for .NET.
  4. OAF for Oracle EBS
  5. ADF for Fusion Apps

What is OAF?

Oracle Applications Framework in abbreviation OAF isA�a framework provided by Oracle, particularly to buildA�applications/ custom boltons for Oracle eBusiness Suite. The interesting fact is OAF doesn’t work without Oracle EBS instance.

Advantages of using Framework/ OAF?

Framework/ OAF has the following advantages:

  1. Streamlines the development lifecycle due to certain standards are imposed to follow during development.
  2. Improves the productivity of the Developer as the Framework provides reusable built-in APIs and packages which minimizes code to be written by developer.
  3. Improves the Quality, Flexibility, Extensibility, Reliability, Robustness of the application built.
  4. Makes Integration easy for intra application and inter applications.
  5. Secures the application from intruders or hackers.

What is MVC?

MVC stands for Model-View-Controller Architecture is an architectural pattern(Refined 3-Tier Architecture) which seperates the application into three layers viz. The Presentation Layer (View), The Business Logic Layer (Controller), The Database Layer (Model). It is widely used industry- standard Web Development Design Pattern which is implemented by different frameworks. Now we will discuss on the elements of MVC:

Model: It is single object which interacts with the Database. Basically it is a Bean class which contains setter and getter methods of all the attributes corresponding to the relational object in the Database.

View: It is Presentation Layer i.e User Interface, where end user interacts in terms to create/ search/ update/ delete data. Data being inserted/ queried in the UI initializes the attributes of Model.

Controller: It is Business Logic Layer. Controller is responsible forA�responding to Users’ action and directing the application flow to appropriate Logic. Data Validation is performed in Controller being taken value of the attributes from Model.

The Diagram is given below to show the interaction between these elements in MVC (Fig. 1):MVC_architecture

OAF Components

Now we will learn about different OAF Components and relation between these components is shown in the Fig. 4A�and Fig. 5.

  • Entity Object (EO): In Single Statement it is the representation of a table in OAF. So for every table, there should be an Entity Object abbrv. EO. EO is used for CRUD(CReate, Update, Delete) operations. Once EO is created, all constraints imposed in the table, will automatically be inherited in the EO. Besides these custom validation logic can also be included here. Mainly Two Files is generated under /schema/server/ when we create Entity Object:
    1. XXRDEmpEO.xml
    2. XXRDEmpEOImpl.java
  • Association Object (AO): Association Object links two Entity Objects(EO) when the tables in the database are composite by nature i.e. Data in these tables has parent-child or master-detail relationship. Association can be of 1:1, 1:n, n:n,n:1 cardinality. Single file gets generatedA�under /schema/server/ when Association is created:
    1. XXRDEmpDeptAO.xml
  • View Object (VO): It is basically a select query on single or multiple EOs or directly from Database Tables. View Object can also be considered as ResultSet. Typically a View Object will have three files under /server/ when created:
    1. XXRDEmpVO.xml
    2. XXRDEmpVOImpl.java
    3. XXRDEmpVORowImpl.java

    VOImpl represents the ResultSet, the data being fetched upon execution of Select Query of VO. and VORowImpl represents a single row within the ResultSet. So all rows with in the ResultSet i.e VOImpl can be accessed through iteration.

    So basically first We have get an instance of VOImpl and then get an instance of VORowImpl and through iteration all the rows can be accessed. Fig. 2 is shown Below:VOImpl_VORowImpl

  • View Link (VL): View Link links two View Objects (VO)A�when the tables in the database are composite by nature i.e. Data in these tables has parent-child or master-detail relationship. View LinkA�can be of 1:1, 1:n, n:n,n:1 cardinality. Single file gets generated under /server/A�when View Link:
    1. XXRDEmpDeptVL.xml
  • Application Module (AM): Application Module in abbrv. AM is basically a container for BC4J Components. AM is responsible for all Database related transactions. A Page must have at least one Application Module attached in order to work. Couple of files get generated underA�/server/A�during creation of Application Module:
    1. XXRDEmpAM.xml
    2. XXRDEmpAMImpl.java
  • Controller (CO): Controller takes the user actions and responds accordingly. Moreover it redirects the application flow to corresponding Logic. Acts like Brain of Human Body. Single File is generated under /webui/ when Controller is created:
    1. XXRDEmpCO.java

    Controller Structure:
    public Class XXMyOrgCO extends OAControllerImpl{
    public void processRequest (OAPageContext pageContext, OAWebBean webBean){
    super.processRequest();
    }
    public void processFormData (OAPageContext pageContext, OAWebBean webBean){
    super.processFormData();
    }
    public void processFormRequest (OAPageContext pageContext, OAWebBean webBean){
    super.processFormRequest();
    }
    }

    A sample controller code is shown above which gets generated when we create a controller for a page. processRequest() and processFormRequest() is visible but not processFormData(). now the question comes is the purpose of these methods in controller andA�which method gets invoked when , processRequest() is invoked when the page renders, processFormData() is invoked for initializing/ mapping data being entered in the page with the VO/EO attributes as the same data has to get saved in DB or shown in the page. processFormRequest() is invoked when some post back event occurs in the page, when I say post back event, that does mean:

    • Click on Submit/ Reset Button.
    • Event/ Fireaction attached on any Item.

    Actually when post back event occurs, both processFormData(), processFormRequest() gets invoked sequentially.

  • Page (PG):A�It’s the UI. An OA Page consists of different regions (discussed later). Therefore a Page can be think of a region, let’s say Main Region(MainRN), RN is the abbreviation for Region. One AM is attached to the MainRN which is aA�PageLayout, which is termed as RootAM, that can’t be extended at any cost as RootAM loads first when BC4J components are initialized and even before page renders. MainRN can have one Controller attached, let’s say MainCO. Within MainRN, there can be many Regions. In this regard I must say that some External region can also embedded with an OA Page. Again AM and CO can be attached to any child region. COA�orA�AM attached to child region will override the action performed by the CO or AM of it’s parent Region. When Page is created a single file is generated under /webui/ directory.
    1. XXRDCreateEmpPG.xml

    The structureA�of a typical page consisting of different regions has been depicted diagrammatically in the figure below (Fig. 3):

    Page Structure
    Page_Structure_OAF

  • Region (RN)
    There are different types of regionsA�available in OAF. We will just have a quick look on very frequently used regions are enlisted below. We will learn about these regions in our successive blogs and will use these regions in our project as well.A�Apart from thisA�elaborate discussion about different regions has been consolidated in the article Regions in OAF. Region can exist without Page as well, termed asA�External Region. The same can be embedded within a Page. Standalone external region can be created which generates a single file under /webui/ directory.

    1. XXRDCountryLovRN.xml

    Here is the list of frequently used regions:

    • pageLayout
    • messageComponentLayout
    • messageLayout
    • header
    • defaultSingleCoulmn
    • defaultDoubleColumn
    • stackLayout
    • query
    • table
    • advancedTable
    • flowLayout
    • rowLayout
    • pageButtonBar
    • subTabLayout
    • train
    • tree
    • hideShow
    • navigationBar
    • popUp

    Below Diagram shows the relation between the OAF components:

    Components when single table isA�associated (Fig. 4):OAF_componentsComponents when multiple tables(parent-child) are associated (Fig. 5):
    OAF_components

MVC & OAF

As depicted in the image below, Page in OAF is nothing but the View Layer in MVC, Controller is same as Controller/ Business Logic Layer in MVC and View Object and Entity Object is nothing but the Model Layer in MVC. Application Module can be think of an interface or an extra layer between Business Logic layer and Model Layer.

Diagram below shows how OAF conforms to MVC Architecture(Fig. 6):

MVC with OAF Components

OAF Directory Structure in Windows

Once the we are done with jdeveloper setup, then the three folders can be seen under C:\jdevtrng folder:

  • jdevbin: contains all framework related libraries, APIs, plugins, IDE etc.
  • jdevdoc: contains all help files regarding usage of Items, Regions, APIs for building OAF application.
  • jdevhome: contains source and compiled code for all the OAF projects. Under jdevhome/jdev/, the following folders are available:
    • dbcfiles:A�contains the .dbc file specific to an instance which is required for guest login to Oracle Apps Login Page followed by authenticating the authorized user for further activity. Moreover it helps inA�Runtime Database connectivity.
    • myprojects: contains the source files (.java,.xml) related to an OAF application.
    • myclasses: contains the compiled files of .java i.e. .class and .xml related to an OAF application.
    • myhtml/OA_HTML: contains the .html, .jsp files.
    • myhtml/OA_MEDIA: contains images like .gif,.jpg, .png files.

Now under jdevhome, jdev and followed by dbcfiles, myprojects and myhtml will be seen (not myclasses, myclasses will be visible after first build/compilation). To build a custom OAF application, one has to comply with this directory creation (this is done by jdeveloper IDE once we create source files corresponding to the Components, no need to create these directory structure in OS manually) and the files related to OAF components need to be placed accordingly in those directories as shown in the diagram which is recommended by Oracle.A�Directory Structure of an OAF application mainly the directory structureA�under myprojects along withA�the source files(.xml,.java) is shown in the diagram below (Fig. 7).OAF_Directory_Structure_in_Windows

Once the source files are compiled, the following directory structure will get auto-generated along with .class files for the corresponding .java source file and .xml will remain same. Diagram is shown below: (Fig. 8):OAF_Directory_Structure_in_Windows_myclasses(After_Compilation)N.B: Source Files will be available under different directories ofA�myprojects folder even after compilation but it wasn’t shown in Fig. 8. This is just to avoid confusion 🙂

Scope in OAF

The types or scope of work in OAF is depicted in the picture below (Fig. 9):

OAF ScopeThank you very much for reading. Hope this article helps you in getting an idea on OAF and it’s fundamentals. In our next blog, we will learn about How to setup Jdeveloper which is the stepping stone towards learning OAF.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here