售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Oracle ADF Real World Developer's Guide
Table of Contents
Oracle ADF Real World Developer's Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Oracle ADF
Introduction to Oracle ADF
Why Oracle ADF?
Oracle ADF architecture
View layer
Controller layer
Model layer
Business services layer
Comparing the Fusion web application technology stack to the Java EE web application
View layer
Controller layer
Data binding layer
Business service layer
Developing with ADF
Setting up the development environment
Picking up the tool for development
Setting up the Software Configuration Management tool
Build tool
Team collaboration
Taking a quick tour of the JDeveloper IDE
Your first Fusion web application
Starting JDeveloper IDE for the first time
Picking up the right application template
Analyzing the generated metadata files
Connecting to the database
What happens when you create a database connection?
Generating the data model and business services
Building entity objects to persist your business data
Building view objects to shape your business data
Building an application module to facade your business service implementation
What is there in your model project source now?
Building user interfaces from the model
What have you got in your view controller project source now?
Deploying and running the application
Running the application using an integrated webLogic server
Running the application on a standalone application server
Summary
2. Introduction to ADF Business Components
Business service layer
Why ADF Business Components?
Overview of ADF Business Components
Oracle ADF Business Components' feature list
Core building blocks
Entity objects
Associations
View objects
View links
Row sets
Query collections
Application modules
Services and service data objects
Building a simple business service
ADF Business Components configuration files
Oracle ADF Model Tester
Using the ADF Model Tester to test the CRUD operations on business data
Testing business methods
Java test client for ADF Business Components
Understanding the runtime behavior of ADF Business Components
Roles and responsibilities of the view object, row set, and query collection
A closer look at query collection
What happens when you execute an entity-based view object?
What happens when you commit a transaction?
Summary
3. Introducing Entity Object
Introduction
Ingredients of an entity object
Runtime collaboration between business components
Core features of ADF entity objects
Developing entity objects
Creating a database connection
Initializing the ADF model project
Creating entity objects
Choosing the database object type
Generating Java classes for entity components
Commonly used properties of an entity attribute
Attribute names in an entity object
Attribute types in an entity object
Using a resource bundle to localize UI hint properties
Accessing the resource bundle from the entity object class
Property set
Creating a property set
Associating the property set with the entity object attributes
Using custom properties in business logic
Persistent and transient attributes
Specifying a default value for an entity attribute
Effective dated entity objects
Defining the primary key
Inheritance hierarchies in entity objects
Creating inheritance hierarchies for entity objects
Updatability of entity attributes
Refreshing attributes on posting changes to the database
Marking an attribute as mandatory
Checking data inconsistency by using the Change Indicator attribute
Queriable attributes
Tracking change history
Configuring UI hints for an attribute
Specifying dependency attributes
Commonly used properties of an entity object
Setting an alternate key for an entity object
Specifying custom properties
Defining entity association
Composition association
Properties of composition association
Retaining the association accessor row set
Adding validation
Adding a validation rule to an attribute
Adding a validation rule to an entity object
Transaction level validation
Defining a custom validation rule
Concurrent access and locking
Configuring Locking Mode for an ADF application
Securing entity objects
Enabling a batch update in an entity object
Working with entity objects
Programmatically creating an entity instance
Entity object in a transaction post cycle
Summary
4. Introducing View Object
Introduction
Concepts and architecture
Ingredients of a view object
Core features of ADF view objects
Developing view objects
Creating view objects
Using the Create View Object wizard
Creating a view object with entity usage mapping
Creating a view object with SQL query
Creating a view object with static list
Creating a programmatic view object
Creating a declarative SQL mode view object
Optionally generating Java classes for a view object
Commonly used properties of view objects
Annotate attributes using UI hints
Adding business rules
Working with view objects
List of values
Configuring the list of values
Linking two view objects
Where clause and Reverse Where clause
Inheritance hierarchies in view objects
Inheritance hierarchies in view objects with non-polymorphic entity usage
Inheritance hierarchies in view objects with polymorphic entity usage
Querying the datasource by using a view object
Specifying the query mode for a view object
Adding WHERE clause to a view object
Appending the WHERE clause at design time
Appending the WHERE clause at runtime
Using bind variables
Programmatically specifying the value for bind variables
Changing the query of a view object at runtime
Programmatically sorting view object rows
In-memory filtering of row sets
In-memory filtering with RowMatch
In-memory filtering by overriding rowQualifies() in ViewObjectImpl
View criteria
Architecture of view criteria
Effective dated view objects
Using alternate keys in a view object
Using findByKey() on view objects
Creating new rows through the view object
Creating child rows in composition association
View link consistency
Configuring view link consistency
How view link consistency works
Why does view link consistency fail when you add a dynamic WHERE clause?
What happens when you execute a view object?
Summary
5. Advanced Concepts on Entity Objects and View Objects
Taking a closer look at entity objects
Lifecycle of an entity object
Reading the current state of an entity row
Reading the originally retrieved attribute value
Retrieving all entity instances in the cache
Lifecycle callback methods of an entity object
What happens when a new entity instance is created?
What happens when an entity instance is modified or removed?
What happens when the transaction is committed?
Building programmatically managed entity objects
Generating a database independent unique ID
How does unique ID sequencing work
Using middle tier generated unique keys
Refreshing entity rows, forgetting the changes
Building custom history types
Taking a closer look at view objects
Lifecycle callback methods of a view object
What happens when a client invokes executeQuery() on a view object instance?
Count queries in a view object
Building programmatically managed view objects
Intercepting query generation for view criteria
Using a custom view criteria adapter
Overriding getViewCriteriaClause(boolean forQuery) in the view object implementation class
Overriding getCriteriaItemClause(ViewCriteriaItem vci) in the view object implementation class
Tips on overriding getViewCriteriaClause() and getCriteriaItemClause() in the view object implementation
Customizing the query at runtime
Customizing the query for a row set
Customizing the query for a view object
Passing parameters to a SQL IN clause using oracle.jbo.domain.Array
Using oracle.jbo.domain.Array as a NamedWhereClauseParam value
Using oracle.jbo.domain.Array as a bind variable value for a view criteria item
Defining a cascading list of values
Switching the LOV at runtime
Reading and writing XML data
Advanced data type techniques
Building custom data types using domain type
Working with BLOB and CLOB data types
BLOB and CLOB support for alternate databases
Building business components dynamically
Building dynamic entity objects and view objects
Steps for building entity definition at runtime
Steps for building a view definition with entity usage at runtime
Personalized business components
Summary
6. Introducing the Application Module
Introduction
Concepts and architecture
Ingredients of an application module
Additional core components
The core features of an application module
Defining an application module
Creating application modules
Optionally generating Java classes for an application module
Adding hierarchical view object instances to an application module
Overriding the default properties of an application module
Commonly used application module configuration properties
Modifying the JDBC data source name for an application module
Overriding properties for a view object instance
Declaratively applying view criteria to a view object instance
Sharing of application module data
An alternative option to define a shared application module
Runtime behaviour of shared application modules
Query execution for a shared view object
Shared query collection cache management
The maximum weight of the query collection pool
Query collection weight
Consuming a shared application module
Accessing view objects defined in a shared application module through a view accessor
Associating view criteria with shared application module instances
Nesting application modules
Accessing a nested application module from the parent
Working with an application module
Exposing the business service method through data control
Where do you write custom business logic in a fusion web application?
Invoking an application module from a Java client
Invoking a shared application module from a Java client
What you may need to know about programmatically releasing an application module?
What happens when a client creates an application module instance?
The lifecycle of an application module
Passivation activation of application modules
Programmatic passivation and activation of custom data
Storing business data at user session level
Using a transient view object
Using a user session data map
Using a client bound session map object
Using JDBC APIs in an application module
Using save points for undo operations
Programmatically configuring an application module
Programmatically building a master-child view object
Using ADF Business Components with Java EE components
Summary
7. Binding Business Services with the User Interface
Introduction
Binding model data with user interfaces
Building a simple data bound web page
Is a view object really a data collection?
What happens when we drop a data collection on a page?
Taking a closer look at the ADF Model metadata files
adfm.xml
DataBindings.cpx
adf-config.xml
adf-settings.xml
Browsing through the page definition file
Parameters
Executables
Bindings
Using the binding editor
Programmatically accessing page binding elements
Accessing binding container
Programmatically accessing the parameter binding
Programmatically executing method action binding
Accessing the list control binding
Accessing the attribute binding
Accessing the iterator binding and associated view object
What happens when you access a Fusion web page?
Invoking an application module from a Java servlet
Using Configuration::createRootApplicationModule() in HttpServlet
Using ADF binding APIs in an HttpServlet
Adding custom phase listeners
Summary
8. Building Data Bound Web User Interfaces
Introduction
The art of laying out pages
Organizing page contents – a case study
Adding actions to your page
Choosing between the managed bean method and the data control method as event handlers
Using managed bean methods as event handlers
Using data control methods as event handlers
Building data bound table UIs
What happens when you drop a data collection as a table on a page?
Commonly used attributes of iterator bindings
What happens at runtime in a data bound table?
Adding edit functionalities for a table
Creating a new row
Deleting a row
Committing changes
Programmatically accessing a selected row from a table
Declaratively reading the attribute value from the currently selected row
Building data bound master-detail UIs
Building a master-detail data model
Building a master-detail UI
What happens at runtime in the master-detail UI?
Building a data bound tree table UI
Building hierarchical view objects
Creating a tree table UI
What happens when you drop a data collection as a tree table on a page?
Decorating the tree table UI
What happens at runtime in a data bound tree table?
Synchronizing UIs using the target data source
What happens at runtime in the target data source?
Adding edit functionalities for a tree table
Configuring the parent view object to retain the view link accessor row set
Creating utility methods for reading RowIterator and selected RowKey for the selected node
Implementing create and delete methods in the application module
Creating a new row
Deleting a row
Programmatically refreshing the tree hierarchy
Accessing web tier values from business components
Using ADFContext to access client specific scoped variables
How does ADFContext provide uniform access across layers?
The pitfalls of using ADFContext
Passing web tier values as parameters to business service methods
Establishing a channel for passing web tier values to the business service layer
Using the user session data map to store values passed from the client
When should the client invoke the method that takes web tier values?
Making the user session data map passivation safe
Building data bound query search forms
Building the view criteria
Using UI hints to control the display for a query component
Building a search UI
What happens when you drop a view criteria as a query component on a page?
Commonly used properties of the search region binding
What is AutoQuery or ClearRowSet behavior?
Initializing criteria item values using web tier values
Programmatically controlling the display of a query component
Programmatically retrieving view criteria used for a query component
Programmatically resetting a query component
Search on a tree table
What happens at runtime in a tree table search?
Building a data bound multi select list
Programmatically accessing selected rows
Overriding UI hints in a view object
Summary
9. Controlling the Page Navigation
Introduction
The navigation model in the JSF framework
Rule based navigation
Implicit navigation
How does implicit navigation work?
The navigation model in ADF
The ingredients of an ADF task flow
Task flow configuration files
ADF managed beans
What you need to know while using managed beans in JSF code?
Task flow activities
View activity
What document type should you choose while creating a JSF page?
Bookmarking view activity
Redirect URL
URL view activity
Specifying parameters for a URL view activity
What happens when runtime invokes a URL view activity from a bounded task flow?
Method call activity
Using a managed bean method in method call activity
Using data control operation in method call activity
Router activity
Save point restore activity
Where are ADF Controller save points created?
Using save points in a task flow
What happens when you create an ADF Controller save point?
Implicit save points
Task flow call activity
Task flow return activity
Parent action
Building an unbounded task flow
Using a managed bean to return a dynamic outcome for a navigation component
Conditionally executing a control flow case
Improving the readability of control flow cases
Adding an exception handler
Customizing the default exception handler
Building a custom javax.faces.context.ExceptionHandler
Using method call activity to initialize a page
Building a task flow with method call activity
What happens at runtime?
Building a menu model
Summary
10. Taking a Closer Look at the Bounded Task Flow
Introduction
The properties of a bounded task flow
Building a bounded task flow
Working with bounded task flow activities
Marking an activity as the default activity
Marking an activity as an exception handler
Calling a bounded task flow using the task flow call activity
Using dynamic task flow calls
Commonly used properties for a task flow call activity
Using remote task flow calls
What happens at runtime when a remote task flow is called?
What you may need to know when you use remote task flow
Parameterizing a bounded task flow
Defining a task flow input parameter
Specifying input parameter values for a task flow
Defining the task flow return value
Reading a return value from a task flow
Consuming bounded task flows as ADF regions
Dynamically displaying the task flow
Lazy loading of an ADF region
Refreshing an ADF region
Displaying task flows using a pop up component
Lazy activation for a task flow when displayed in a pop up
Using a contextual event for communicating to an ADF region
Contextual event model
Using a contextual event
Defining an event publisher
Defining an event subscriber
Defining an event handler method
Subscribing to desired events
Contextual event propagation at runtime
Dynamically adding multiple regions to a page
Distributing ADF task flow as the ADF library
Packaging the task flow into the ADF library
Consuming task flows added into an ADF library
Using a train component in a bounded task flow
Creating a train in a bounded task flow
Setting display names for train stops
Customizing the display for train stops
Programmatically navigating between train stops
Executing methods while navigating between train stops
Transaction management in a bounded task flow
What happens at runtime?
Programmatically managing transactions for a task flow
The life span of a bounded task flow
Summary
11. More on Validations and Error Handling
Introduction
Adding validation rules in a fusion web application
Defining validations in the ADF view layer
Defining a custom ADF Faces validator
Step1: Defining client-side validation in JavaScript
Step 2: Defining the validator Java class
Step 3: Configuring and using the validator
Defining validations in the ADF model layer
Defining validations in the ADF Business Components layer
Validations using custom domain objects
Creating and registering custom message bundles
What you may need to know while using custom domain types on the UI
When does the framework validate the custom domain object?
Where to put validation in a Fusion web application
Displaying validation exceptions on a page
Where in the page lifecycle does validation occur?
Client-side validation
Server-side validation
Error handling in ADF
Taking a closer look at DCErrorHandlerImpl
Programmatically throwing validation exceptions in business components
Localizing validation error messages
Resource bundle usage in entity objects and view objects
Resource bundle usage in the application module
Reading the resource bundle definition from the business component
Programmatically throwing validation exceptions
Building a validation exception using message strings from the resource bundle
Validation class hierarchy
Wrapping exceptions
Programmatically throwing multiple RowValException
Programmatically throwing AttrValException
Customizing default business component error messages
Step1: Creating and registering a custom message bundle
Step 2: Customizing the DCErrorHandlerImpl
Step 3: Registering the CustomErrorHandler
How does the CustomErrorHandler implementation work?
Skipping validation
Skipping validations in the ADF Faces layer
Skipping validations in the business components
Summary
12. Oracle ADF Best Practices
Introduction
Setting up the project structure for your Fusion web application
Single application workspace comprising of multiple projects – monolithic approach
Multiple application workspaces controlled by a single master application– microkernel approach
Guidelines for setting up the application source using the microkernel approach
How to avoid cyclic dependency between modules
The life span of ADF Business Components
Life span of an application module
How the framework allocates an application module for serving a client request
More configuration options for an application module
When an application module is removed from the pool
Configuring the application module pool parameters – a case study
Life span of a view object, row set, and query collection in a regular application module
The query collection cache and view accessor row set
The life span of entity objects
What if you want to clear an entity cache at specific points in time?
The life span of row sets in a shared application module
The life span of binding objects
The best practices and performance tuning for Oracle ADF
Tuning tips for an application module
Tips for optimizing an application module initialization
Tips for optimizing resource usages in an application module
Tips for fine-tuning the JDBC API use
Coding guidelines for application modules
Tuning tips for view objects
Tips for optimizing query execution in a view object
Tips for optimizing database read operations
Tips for setting a global row fetch limit for view objects
Tuning view criteria in view objects
Tips for optimizing LOV definitions
General tips for tuning view objects
Coding guidelines for view objects
Tuning tips for entity objects
Design guidelines for entity objects
Tips for validating entity objects
General tips for tuning entity objects
Coding guidelines for entity objects
Tuning tips for ADF model
Tips for tuning executable bindings
Tips for optimizing data traffic between a binding layer and business components
Tips for optimizing count query executions
Coding guidelines for ADF binding APIs
Tuning tips for ADF Controller and task flows
Tips for optimizing resource usage in a task flow
General guidelines for building successful task flows
Coding guidelines for managed beans
Tuning tips for ADF Faces
General tips for ADF Faces pages
Best practices for ADF Faces UI components
Internationalization of Fusion web applications
Configuring the time zone for a Fusion web application
Ensuring high availability for Fusion web applications
How does a bean data control participate in session replication in high availability mode?
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜