Architecture Overview
BC4J - Java business components for representing
business logic UIX - Java components for representing UI OA Extension Declarative data for UIX Extension to JDeveloper
Resides in database or XML files Formerly known as JRAD Replaces AK (Framework 5.6 and earlier)
Architecture Overview
AOL/J - Applications authentication, authorization and
java services OA Framework - Programmatic glue which integrates these technologies
Model-View-Controller (MVC) Architecture
A component-based design with clean interfaces among model, view, and controller objects The controller responds to user actions and directs application flow Controller
Model View
The model encapsulates underlying data and business logic of the application
The view formats and presents data from a model to the user
Flexible Architecture
UIX
View Common UIX-based HTML components used throughout Applications
OA Controller
Controller OA Controller responds to user actions, directs application flow
Model Business logic encapsulated in Business Components for Java view objects and entity objects
BC4J
Client
OA Framework Application Architecture Server Data Server
Listener
Browser
Servlet Engine
UIX OA Controller BC4J MDS
Metadata Repository
Data
Tech Stack Components
BC4J - Java business components for representing
business logic UIX - Java components for representing UI OA Extension Build declarative data for UIX
Extension to JDeveloper Metadata resides in database or XML files
OA Framework - Programmatic glue that integrates
these technologies
Encapsulation: Layered Reusability Each layer only knows about the layers
below it. This encapsulation allows reuse at any of the layer boundaries.
OA Controllers Application Modules View Objects
dataflow up stack (pull) dataflow down stack (push)
Entity Objects DB
Model: Business Components for Java
There are three basic component classes The Application Module a container for related BC4J objects Entity objects encapsulate business rules View objects present data to the Framework page
Model: Relationships
Model: Application Modules
Application Modules serve as containers for related
BC4J objects The objects are related by participating in the same task (for example, a multi-page UI for creating purchase orders) Application Modules provide transaction context Application Modules establish database connections Application Modules may be nested to provide more complex application modules
Model: Entity Objects
Entity objects Encapsulate business rules and logic Are used by any program that inserts, updates, or deletes data Provide consistent data validation across all applications May be linked to other entity objects by entity association objects
Model: View Objects
View Objects Encapsulate a database query Provide iteration over the query result set May be based on plain SQL if the UI is not for update May be based on multiple entity objects if the UI is for update Provide single point of contact for getting and setting entity object values May be linked together by view links
Model: Controlling Transactions
The OADBTransaction class encapsulates the JDBC
connection for your transaction You can use this object to:
Create a callable statement for executing PL/SQL functions and procedures Access session-level Applications context information Access OANLServices object for NLS operations
View: OA Framework-Based Page
View: Java Objects in a Page
Each UI widget corresponds to one or more Java
objects (beans) The Java objects are assembled declaratively with the Oracle 10g JDeveloper OA Extension tool
The Java beans are defined hierarchically
The Java objects are used to create HTML at runtime
View: A Framework Example
Header Bean Submit button Bean
Results table Bean
View: Page Hierarchy
This is the page structure
as seen in OA Extension at design time.
The Framework uses the
order of the items to determine their position within a page or region UI at runtime.
View: A Framework Region
A region can contain Buttons Fields Images Other regions Headers and so on
A region is a reusable container that holds items
Regions can inherit properties from other regions The top level of every page is a region with a
'pageLayout' style
View: Reusing Page Components with the Extends Property
extend them.
To incorporate shared objects into a page, you can
Create a region or item in your page. Set its Extends property to point to the desired region or item.
Any child regions or items in the shared
component are also included. Model and controller logic comes with the shared component. Entire page contents (top-level region) can be reused this way.
View: Attribute Sets Improve Consistency
An attribute set is a named, reusable collection of
properties.
Can be used by any type of UI object, including
regions, items, and other attribute sets Used for prompts and similar property values in the E-Business Suite Typically one attribute set per displayable column in applications tables Created in an XML package file
View: Data Source Binding
Beans with any database interaction must specify
a data source binding to a view attribute in a view instance.
Query, insert, update, delete
Specify View Instance, View Attribute properties
for the item to bind the data source The view instance must be included in the page's root application module (or in one nested underneath the root application module).
The View - Design Time
Developers use Oracle
10g JDeveloper OA Extension to create pages declaratively. Pages are made up of a hierarchy of regions and items.
The order of the items
determines their position within a page or region UI at runtime.
The View - Personalization
Customers and third parties use the Personalization
Framework to modify pages to fit business needs and user preferences.
Controller: Controlling UI Behavior
Controller classes define how your Java Beans
behave. You can override controller classes to:
Manipulate the UI at runtime Manually initialize data items Intercept and handle user events like button clicks
Controller classes subclass
OAControllerImpl.
OAPageBean is the main OA Framework page
processing class. There are methods in the Controller class to handle GET and POST requests.
Controller: Handling a GET Request
The OAPageBean calls the processRequest
method when a browser issues a GET request. The OAPageBean uses this method to build the bean hierarchy. The processRequest method is called for each bean in the page hierarchy. You can override this method on any of the container beans in the hierarchy. The processRequest() method can be used to
Customize page layout at runtime Perform manual data initialization Perform an autoquery
Controller: Handling a POST Request
The OAPageBean calls processRequest for
each Bean in the hierarchy (similar to a GET). The OAPageBean then calls processFormData for pages that insert or update data. The processFormData method reads form field data to apply it to underlying view object attributes (invokes attribute- and entity-level validations). The Framework calls the processFormRequest method next. Override the processFormRequest method to add special event handling logic.
Controller: The OAPageContext Object
The Framework creates an OAPageContext object
for each request received The methods that handle GET and POST requests accept OAPageContext as an argument This object contains parameters from the requesting page It also contains form fields if the request is a POST
Controller: The OAPageContext Object
The OAPageContext object provides: Access to the server Application Module Class Methods to perform JSP forwards and client redirects Access to session level Application context for
User name Id Current responsibility and so on
Controller: OAPageContext Interaction with Model
Controller: Applications Context
The Framework application keeps track of
applications context by:
Creating a WebAppContext object when a user logs in to a Framework Application Creating a session-based cookie Current responsibility Organization id User characteristics (username, userid, and so on)
These two objects keep track of information like
This information is accessible from
OAPageContext (on the client) or OADBTransaction (on the server)
Client and Server
Client Tier Middle Tier
Client Side OAPageContext Find AM Invoke Method Server Side OADBTransaction
Server Tier
AM finds VO
webui
server
Resources
Further reading: OA Framework Developer's Guide: Anatomy of an OA Framework Page OA Framework Javadoc
Summary
The development environment includes many
components, such as JDeveloper, OA Extension, BC4J, and OA Framework Follow the Model-View-Controller design pattern Business logic/data handling (model) is done using BC4J The UI (view) is done using OA Extension and the Repository with UIX OA Framework (controller) wires the data handling to the UI