OAF MVC Architecture

MVC

M:The Model is the place containing the business logic.

V:The View is the presentation layer.

C:The Controller manages the flow between pages.


OAF MVC Architecture


or




1] Model

BC4J(Business Components For Java) have three basic component classes:

Application Module - a container for related BC4J Object

Entity Objects - encapsulate business rules

View Objects - present data to the Framework page

BC4J is used to Business Logic and Data Handling Model


Model contains the components which handles data directly from Database. It Includes Business Components for Java (BC4J Objects) which mainly are:

Entity Objects (EO):

Entity Objects are generally based on one table which encapsulate the business rules. These objects are used by OAF page to perform update/insert/delete operations. You can join two EOs using Entity Associations.

View Objects (VO):

These objects contain a SQL query that queries the data from database and present it in the OAF page. VOs can be based on one or many EOs or a SQL query. Two VO can be linked together through a View Link.


Application Module (AM):

It is a very important component for the package, it is the one which governs the entire session pool, access to database and the business logic components, every page should be attached to some AM.

It is a container for related BC4J objects and provides the database connection. It also provides Transaction Context (OADBTransaction) or Transaction Management. An AM can have more nested AM contained in it along with other BC4J components. But it is mandatory to have an AM for an OAF page.

2] View

View contains the actual page items on page which user can see. The view in OAF comprises of various page level items like text fields, buttons, regions, links etc. These items are visible on any OAF page. These items can either be tied to VO attribute or having a constant value or populated at run time based through controller logic.

Please note that- View Layer is altogether different than View Object!!!!!

3] Controller

Controller:Controlling UI Behavior, You can override controller classes to:

  • Manipulate the UI at runtime
  • Manually initialize data items
  • Intercept and handle user events like button clicks

Controller handles all the user actions done on the page. OAF requires a java controller class to be defined for a page/region which handles various page level actions. The important methods in this class are:

A] ProcessRequest

This request is called when page is rendered. Any logic to be executed during page initialization is kept here.

B] ProcessFormRequest

Any page submit action causes ProcessFormRequest to be executed. The logic put here typically is that which needs to be executed after actions like button click or any other page submit action.

The Controller class is mostly used to put logic for actions on page such as button clicks, navigation to other pages. The two objects that are passed to controller methods are OAPageContext and OAWebBean. OAPageContext provides access to objects like AM class, page parameters, session values, navigation methods. OAWebBean is generally used to get a handle of page items.


OAF Directory Structure

1) Entity objects: package name should end with .schema.server
2) Application module: package name should end with .server
3) View objects: package name should end with .server
4) View objects (for LOVs): package name should end with .lov.server
5) Page definitions & controllers: package name should end with .webui

Examples:

VO
(Path:oracle\apps\inv\txnui\lotDetails\server)
MtlLotNumbersVO.xml
MtlLotNumbersVOImpl.java
MtlLotNumbersVORowImpl.java
InvItemVO.xml
InvItemVOImpl.java
InvItemVORowImpl.java

EO
(Path:oracle\apps\inv\schema\server)
MtlLotNumberEO.xml
MtlLotNumberEOImpl.java

AM:A BC4J Container
(Path:oracle\apps\inv\txnui\lotDetails\server)
InvLotDetailsAM.xml
InvLotDetailsAMImpl.java

View
(Path:oracle\apps\inv\txnui\lotDetails\webui)
LotDetailsRN.xml(This RN can be referred by any PG.xml which need Lot Entry)
Seach LotDetailsRN.xml,you will see AM:InvLotDetailsAM and Controller:InvLotDetailsCO

Controller
(Path:oracle\apps\inv\txnui\lotDetails\webui)
InvLotDetailsCO.java


Misc



Flexible Architecture

Each layer Only "Knows" about the layers below it.


Region(RN) in Page Bind to AM

Region(RN) in Page set a Controller



Reference:http://docs.oracle.com/cd/B10500_01/appdev.920/a96621/adx25bc4.htm


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值