You are on page 1of 17

Exposing Data

Copyright © 2008, Oracle. All rights reserved.

All rights reserved. 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. . Objectives After completing this lesson. Oracle.

related to an end-user task. Oracle ADF Application Module (AM) An Oracle ADF Business Component that encapsulates: • Active data model • Business service methods • for a logical unit of work. OrderAM PersonsVO1 OrdersVO1 via PersonOrderVL 6-3 Copyright © 2008. All rights reserved. . Oracle.

Oracle. 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. 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.

choose ADF Business Components > Application Module to invoke the Create Application Module Wizard. 6-5 Copyright © 2008. 2. Oracle. 3. . All rights reserved. In the New Gallery Business Tier. Specify a name for the application module and identify the package where it should belong. Define the data model for the application module by selecting view objects from a tree of available view objects. Creating an Application Module 1.

All rights reserved. Defining the Data Model for the Application Module 6-6 Copyright © 2008. . Oracle.

6-7 Copyright © 2008. 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. . Oracle. All rights reserved.

• 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. 6-8 Copyright © 2008. • Consider service or transaction flow. All rights reserved. or lots of little ones? • An application module is a logical unit of work. . Oracle. Determining the Size of an Application Module Is it better to have one big application module.

deletes. so all are committed or rolled back at once • For nested application modules. Business Components Transactions • Application modules: – Handle transaction and concurrency support – Use a single database connection – Provide transaction context for updates. • No coding is required unless you want to modify the default behavior. . Oracle. 6-9 Copyright © 2008. and inserts for all view objects in the application module. the outermost application module provides the transaction context for the others. All rights reserved.

12 Copyright © 2008. 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 Available Referenced: I’d like to be used by User2 Unavailable: I’m busy right now! 6 . . Oracle. All rights reserved.

13 Copyright © 2008. 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 Saved state Passivation Activation 6 . Oracle. .

The Role of ADF Model Desktop Browser-based ADF Swing Office JSP JSF ADF Faces / DVT View Metadata Services (MDS) Controller Struts JSF/ADF Task Flow ADF Bindings Model Java EJB BAM BPEL Web ADFbc BI Essbase Portlets Services Business TopLink Services Data Services Relational Data XML Data Legacy Data Packaged Apps 6 . . All rights reserved. Oracle.14 Copyright © 2008.

Describing the Course Application: Database Objects 6 . .15 Copyright © 2008. All rights reserved. Oracle.

All rights reserved. Oracle. 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.18 Copyright © 2008. Describing the Course Application: Data Controls 1 3 5 4 2 6 6 . All rights reserved. .

.19 Copyright © 2008. Summary In this lesson. All rights reserved. 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 . Oracle.

Oracle.20 Copyright © 2008. . 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 .