You are on page 1of 17

6

Exposing Data

Copyright © 2008, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to do the


following:
• Explain the role of application modules
• Describe the characteristics of application modules
• Create an application module
• Explain how application modules can manage:
– Business components transactions
– Application state
• Explain the role of the ADF Model

6-2 Copyright © 2008, Oracle. All rights reserved.


Oracle ADF Application Module (AM)

An Oracle ADF Business Component that encapsulates:


• Active data model
• Business service methods
• for a logical unit of work, related to an end-user task.

OrderAM

PersonsVO1

OrdersVO1 via PersonOrderVL

6-3 Copyright © 2008, Oracle. All rights reserved.


Characteristics of an Application Module

• Represents the data model that the client uses and has
one connection to the database
• Provides transactional context for the application
• Enables you to gather data customized to a client interface
so that data can be retrieved in one network round-trip
• Can contain other application modules, called nested
application modules
• Keeps track of all changes that affect data in the database
• Provides remotely accessible methods to implement
application module behavior
• Is deployable in multiple configurations
• Can be easily reused in business logic tiers of other
applications

6-4 Copyright © 2008, Oracle. All rights reserved.


Creating an Application Module

1. In the New Gallery Business Tier, choose ADF Business


Components > Application Module to invoke the Create
Application Module Wizard.
2. Specify a name for the application module and identify the
package where it should belong.
3. Define the data model for
the application module by
selecting view objects
from a tree of available
view objects.

6-5 Copyright © 2008, Oracle. All rights reserved.


Defining the Data Model for the
Application Module

6-6 Copyright © 2008, Oracle. All rights reserved.


Using Master–Detail View Objects
in Application Modules

First level: Independent VO instances

OrderAMDataControl

CustomerVO1

OrderVO1 via CustomerToOrder

OrderVO2

Subordinate levels: VO instances accessed via a view link


display both master and detail.

6-7 Copyright © 2008, Oracle. All rights reserved.


Determining the Size of an
Application Module

Is it better to have one big application module, or lots of little


ones?
• An application module is a logical unit of work.
• Let use cases drive application module decisions:
– Can be grouped by domain business objects involved
– Grouped by the user-oriented view of business data required
• Consider the possibility of reuse of the application module.
• Consider service or transaction flow.

6-8 Copyright © 2008, Oracle. All rights reserved.


Business Components Transactions

• Application modules:
– Handle transaction and concurrency support
– Use a single database connection
– Provide transaction context for updates, deletes, and inserts
for all view objects in the application module, so all are
committed or rolled back at once
• For nested application modules, the outermost application
module provides the transaction context for the others.
• No coding is required unless you want to modify the
default behavior.

6-9 Copyright © 2008, Oracle. All rights reserved.


Application Module Pooling

Application module pooling:


• Enables users to share application modules
• Manages application state
• Provides the same instance or one with an identical state
when requested by an application with managed state
Order Application Module Pool

rA
M Available
rd e
O

M
Referenced: I’d like to be
d e rA used by User2
Or

M Unavailable: I’m busy


e rA
O r d right now!

6 - 12 Copyright © 2008, Oracle. All rights reserved.


Managing Application State

• AM passivation saves transaction state in an XML


document stored in database
• AM activation retrieves saved transaction state
• Performed automatically when needed

51
10

Saved 10
51
10
5 1 state

Passivation Activation

6 - 13 Copyright © 2008, Oracle. All rights reserved.


The Role of ADF Model
Desktop Browser-based

ADF Swing Office JSP JSF ADF Faces / DVT View

Controller
Struts JSF/ADF Task Flow

ADF Bindings Model

Java EJB BAM BPEL Web ADFbc BI Essbase Portlets


Services Business
TopLink Services

Data
Relational XML Data Packaged Services
Legacy Data
Data Apps

6 - 14 Copyright © 2008, Oracle. All rights reserved.


Describing the Course Application: Database
Objects

6 - 15 Copyright © 2008, Oracle. All rights reserved.


Describing the Course Application: View Objects

View objects exposed in View objects used


application modules for LOVs in the UI

6 - 16 Copyright © 2008, Oracle. All rights reserved.


Describing the Course Application: Data Controls

1 3 5

4
2

6 - 18 Copyright © 2008, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Explain the role of application modules
• Describe the characteristics of application modules
• Create an application module
• Explain how application modules can manage:
– Business components transactions
– Application state
• Explain the role of the ADF Model

6 - 19 Copyright © 2008, Oracle. All rights reserved.


Practice 6 Overview:
Defining Application Modules

This practice covers the following topics:


• Packaging view objects in application modules to provide
the data needs of the application
• Testing the business components

6 - 20 Copyright © 2008, Oracle. All rights reserved.

You might also like