Below is the MVC architecture of OAF
MODEL
The entire database related transactions in OAF pages will be taken care by the MODEL. Model is where the application implements business logic.
The major components of Model are:-
- Application Module(AM)
- Entity Object(EO)
- View Object(VO)
Application Module (AM)
Application Module in OAF is the most required step to create any OAF page. Application Module is handle all the Runtime connections between the Page and the Database. Any OAF page cannot be run in the application until unless Application module(AM) is not assigned to that OAF Page. If we are using the View object in the OAF Page , then again we cannot access these View Objects (VO) in that OAF page until unless we will not assign this VO to the Application Modules. So AM is the mandatory step in the OAF page to run in the Application.
One OAF page can have one Application module also or more then one application Module Too. This is not restricted that there will be only one AM in the OAF page. This could be more then one. In the Same time , We can assign more then one View Objects in the Application Module Too. Application module helps to get the access of the View object in the OAF page during run time.
Types of AM:-
Root AM:- Application module that is attached to the Top most of the OAF page or to main region works as the Root application Module
Nested AM:- Application module that is attached to child region is called Nested AM
All the pages are attached to the AM
The entire application module that you create is subclass of:
oracle.apps.fnd.framework.server.OAApplicationModuleImpl class.
- Application module serves as a container for related BC4J objects.
- Application module provides transaction context.
- Application module establish database connection.
Entity Object (EO)
Entity object encapsulates business rules and logic. Entity objects are mainly used by any program that inserts, updates or deletes data. Entity object provides consistent data validation across all application. Entity objects may be linked to other entity objects by entity association objects. Entity Object map to a database table or other data source.
Entity Objects can be created on database objects like Table, View, Synonym etc or other Entity Objects.
Entity Objects are mainly used for insert, update or delete the records from database. Entity Object will take care of business logic and validation related to a table. Entity Object Encapsulate the attribute level and entity level validation.
OA Framework supports both Java and PL/SQL entity objects
If we want to perform the DML operations on the standard (Seeded) table then we go for PL/SQL based Entity Object.
If we want to perform the DML operations on the custom table then we go for Java Based Entity Object
All the entity objects that you create are subclass of:
oracle.apps.fnd.framework.server.OAEntityImpl class
While Creating the Entity Object always generate accessors (setters/getters).
EO should have following attributes(WHO COLUMNS):-
- CreationDate
- CreatedBy
- LastUpdateDate
- LastUpdatedBy
- LastUpdateLogin
After creating the entity object always attach that to VO
View Object (VO)
View object encapsulates a database query. View object provide iteration over the query result set. View object primarily based on Entity Objects (EO) or may be based on plain SQL or may be based on multiple EOs. View object provides single point of contact for getting and setting EOs values.
View Object is mainly used for Manage collection of data and to display them in OAF page.
View Object represents a query result.
View Objects are used for joining, filtering, projecting and sorting your business data.
View Object can be created in three ways:-
- Generated SQL based on EOs.
- Expert Mode custom SQL with no underlying EOs.
- Expert Mode custom SQL manually mapped to EOs.
View Object can be created on the bases of Single Entity Object or more than one Entity Object.
View Object can also be created from SQL statements.
A VO controls many view rows. Each view row represents a row of the data that is queried from the database. When you want aliases in the query, make sure that the attribute settings in the VO wizard include the alias names.
All the view objects that you create are subclass of:
oracle.apps.fnd.framework.server.OAViewObjectImpl class.
While creating always create View Row Java class (ViewRowImpl) and accessors (setters/getters).
Each VO should have:
<Name>VO.xml
<Name>VOImpl.java (optional)
<Name>ViewRowImpl.java (required)
After creating the view object always attach that to AM
VIEW
View is nothing but the OAF page (or Region) output.
Each UI (User Interface) widget corresponds to one or more java objects (Beans).
The java objects are used create HTML at run time. Customers and third parties use Page Personalization to modify pages to fit business needs and user preferences.
CONTROLLER
Controller controls the UI behavior. Controller classes define how your java beans behave.
Controller classes have the subclass OAControllerImpl
OAPageBean is the main OA Framework page processing class.
There are methods in the Controller class to handle GET and POST requests.
- processRequest
- processFormData
- processFormRequest
The OAPageBean calls the processRequest method when a browser issues a GET request. This is called only once when page is loaded first time.
The OAPageBean then calls processFormData for pages that insert or update data.
The OAPageBean calls the processFormRequest method when a browser issues a GET request. This is called every time on user action like click of button.
Comments
Post a Comment