MVC Architecture in OA Framework

The MVC architecture, being the industry standard for networked applications is employed in the Oracle Applications Framework and various components of the OA framework help implement the features of MVC.


The Model
The Model in the OA framework is known as the Application Module or the AM. It is implemented using the Oracle Business Components for Java (BC4J) which is optimized ready-to-use implementation of J2EE design patterns. These BC4Js actually help the developers to concentrate on writing code for business logic rather than code for the connecting glues and pipes.

The BC4J application model (AM) is basically a container that manages and provides access to related model objects i.e. the ones that participate in same end-to-end transactions. Each OA Framework page has a root AM that is associated with the top level region of the page known as the Page Layout region.

The other basic functions of the AM are:- 
·         Providing context to the transactions. This context is known as the Page Context.
·         Establishing Database Connections.
The View
The View in the OA Framework is implemented using the User Interface XML or UIX. UIX uses XML to describe the components and hierarchy that make up an application page. The metadata used to describe the UI is loaded into a database repository, called Meta Data Services (MDS), at deployment time and optionally at design time as well. UIX also provides runtime capabilities to translate this metadata into HTML output so that it can be shown on a Browser or a mobile device. Various features that can be implemented using OA Framework UI are:-

·         PPR – Partial Page Rendering for displaying only the requisite parts of a page at a time.
·         Hot Keys – Numeric keys for easy access to specific fields on a form
·         LOV Auto Completion – Also known as List Of Value Completion that helps search a value to enter from a long list of values
·         Smart Poplist – Query based independent drop down lists.

The Control
The Control in the OA Framework is known as the Controller Object or CO and has a normal java class based implementation. Its major functions are:-
                Handling user-driven interactions.
                Handling application-driven interactions.
                Implementing two step transactions i.e. two step page flows.
                Instantiating the Model objects.
                Invoking appropriate Model object methods.
                Displaying context based UI messages.

The controller is basically limited to contain two java methods which are of primary use. One is the processRequest function which is called when the page is being rendered for the first time. The other function is the processFormRequest which is called on submits or page events.

Other objects of Concern
The other objects that hold an important place in the OA Framework are discussed as follows:-
View Objects
A view object is the medium that transports data from the Application Module i.e. the Model to the UIX based view. The prime purpose of the view object is to carry the SQL query that will be run by the model. The flow of view object usage is explained as follows:-

1.    Creating a View Object.
2.    Incorporating the SQL query in the View Object.
3.    Binding the widgets on the view or the UI with the View Object Attributes.
4.    AM instantiates the View Object.
5.    AM executes the view object query.
6.    Data gets displayed on the view. (Provided flow point III has been performed correctly).

Entity Objects
View Objects suffice the purpose of display of data from the underlying database. However, another important task is to perform updates and inserts on the same data. Entity objects help perform this tedious task. Entity objects generally bind in one to one format with a database object like a view or table. The flow of entity object usage is as follows:-
                Creating an Entity Object by choosing the appropriate database object.
                Defining a View Object based on this Entity Object.
                Binding the widgets on the view with the View Object Attributes.
                Firing transaction start, execute and end commands from the CO and the AM.
                Executing the required actions from the View.