Anda di halaman 1dari 36

1

<Insert Picture Here>


Oracle ADF11g Workshop
Introduction to ADF Business Components
3
Oracle ADF Technology Stack
ADF Model
Struts
JSF
JSF/ADF Faces
JSP
ADF Swing
View
Controller
Model
(JSR 227)
Business
Services
Rich Client Web / Wireless
Relational Data XML Data Legacy Data
Data Source
EJB/
Toplink
ADF
Business
Components
Java
Classes
Web
Services
Portlets
Packaged Apps
4
ADF Business Components
ADF is a framework that simplifies developing Java EE
business services for developers familiar with declarative
development and relational databases
Complete business tier development framework
Provides data interaction & business logic execution
Enables declarative-style development
Wizard-based and visual development
Implemented in metadata, not code
Enables business logic development
Pre-defined Java methods for common events (create,
delete, row currency)
Declarative business rules
5
Start with Your Database
Tables
6
Entity Objects Encapsulate
Business Rules, Logic, Defaults
in a Consistent Way for a Table
7
View Objects Encapsulate SQL
Queries to Project, Join, Filter,
Order Data for External Client
Interaction
8
Application Module Defines Data
Model of View Object Usages for
a Complete Application Use Case
9
User Interfaces Work with the
Application Module as Their
Backend Business Service
10
As You Build New Applications,
Underlying Components Are
Reusable
11
Automatic Master Detail Coordination
(Simple Master/Detail Form in JDeveloper/ADF)
12
Types of ADF Business Components
CustomerEO
OrderEO
LineItemEO
OrdVO
CustVO
CustomerOrder
AllOrders
Customer
Application Module
with View
Object Instances
View
Objects
and
View
Links
Entity Objects
and
Associations
13
Business Components Model
Application tasks
Transaction handling OrderEntryApp
Application
module
(Service)
View
objects
Entity
objects
PriorityOrder ItemList
Customers Orders OrderItems
Client-Facing
Reusable
Query
Components
Business Domain
Reusable
Business Logic
and Persistence
Components
14
Using Entity Objects to Persist Data
CustomerEO
Id
Name
Status
Email
Entity
object
Attributes
Database
table
Status List
(Gold Silver Platinum)
Validation
rule
ID
201
NAME
Steve
STATUS
Gold
Email
msmith@company.com
202 Mike Silver dgonzales@company.com
CUSTOMERS
15
Entity Objects
Represent a database table or other data source
Handle database interaction
Contain attributes representing the database columns
Encapsulate attribute-level and entity-level validation
logic
Are actively linked with associations
16
Entity Objects
Contains information about the CUSTOMER table
Defines the attributes of a customer, including data type and
database column mapping
Enforces validation logic, such as a list of valid values for the
customer status
Can contain custom business methods
17
Creating Entity Objects
Tightly integrated in the JDeveloper IDE, with productive,
declarative wizards.
Name page
Attribute Settings
page
Attributes page
18
Files Generated for Entity Objects
Customer.xml: Metadata
Always generated
The Entity Object Wizard gets all of its
information from this file
CustomerImpl.java: Entity object class
Extends the EntityImpl class
Generation is optional
CustomerDefImpl.java: Entity definition class
Extends the EntityDefImpl class
Generation is optional
19
Entity Objects - Associations
An association is an active link between entity
objects, indicating that one entity references another.
Associations are automatically created between entities
that represent tables that are joined by a foreign key
constraint.
Associations are implemented by a single xml file, for
instance OrderPlacedBy.xml.
20
Business Logic
Is generally defined at the entity object level
Includes validation and business rules
Is defined in different ways:
Declarative: defined in wizards and editors
Programmatic: coded in Java
Domains: custom datatypes
21
Business Components Model
Application tasks
Transaction handling OrderEntryApp
Application
module
(Service)
View
objects
Entity
objects
PriorityOrder ItemList
Customers Orders OrderItems
Client-Facing
Reusable
Query
Components
Business Domain
Reusable
Business Logic
and Persistence
Components
22
Characteristics of View Objects
Represent a query
Are used for joining, filtering, projecting, and sorting
business data
Enable you to have a view of data that is specific to one
part of your application
Can be constructed from a SQL statement, static values,
or populated programmatically
Can also be based on any number of entity objects
Are linked using Viewlink objects
View
objects
PriorityOrderVO ItemListVO
Reusable
Query Components
OrderPlacedByLink
23
Files Generated for View Objects
OrderView.xml: Metadata
Always generated
The View Object Wizard gets all its information from this file
OrderViewRowImpl.java: The view row class
Contains getter and setter methods for each attribute in the
View Object.
Generation is optional
OrderViewImpl.java: The view class
Generation is optional
24
View Links
A View Link is an active link between view objects.
Used to enforce Master-Detail relations between
Views.
Implemented by a single XML file, for instance:
OrderForItemLink.xml
25
Master-Detail Views
Different types of master-detail relationships are supported.
26
Business Components Model
Application tasks
Transaction handling OrderEntryApp
Application
module
(Service)
View
objects
Entity
objects
PriorityOrder ItemList
Customers Orders OrderItems
Client-Facing
Reusable
Query
Components
Business Domain
Reusable
Business Logic
and Persistence
Components
27
ADF Application Modules
Contain an active data model that the client uses to interact with
view object instances
Contain Views and View Links
Control the connection to the database and keep track of all
changes that affect data in the database
Handles transactions (commit, rollback)
Provide remotely accessible methods to implement application
module behavior
Are easily reused
PersonsVO1
OrdersVO1 via PersonOrderVL
OrderAM
28
J2EE Architecture using ADF BC
29
Testing the Business Components
Right-click the Application Module and select Run.
Select the configuration and database connection.
30
DEMO
Design a simple ADF App based on the
Dept & Emp Tables
31
ADF Bindings
32
Oracle ADF Technology Stack
ADF Model
Struts
JSF
JSF/ADF Faces
JSP
ADF Swing
View
Controller
Model
(JSR 227)
Business
Services
Rich Client Web / Wireless
Relational Data XML Data Legacy Data
Data Source
EJB/
Toplink
ADF
Business
Components
Java
Classes
Web
Services
Portlets
Packaged Apps
33
JSF
ADF Architecture
ADF Data Control
ADF Bindings Portlet Bindings
Struts Faces Controller
ADF Faces JSP ADF Swing
Java
Classes
EJB
ADF
Business
Components
Web
Services
Portlets
JSR-168
WSRP
View View
Controller Controller
Model Model
(JSR 227) (JSR 227)
Business Business
Services Services
TopLink Data Services
Relational Data XML Data
M
e
t
a
d
a
t
a

S
e
r
v
i
c
e
s

(
M
D
S
)
Packaged Apps
JDBC JCA WS XML
Mobile Bindings
Legacy Data
34
The Model Layer
Business
Services
Model
TopLink Mapping
TopLink Mapping
ADF
Entity Object
Web
Services
Web
Services
ADF
Application
Module
ADF
View Object
Java
Classes
Java
Classes
EJB
Session
Beans
EJB
Session
Beans
EJB
Finders
EJB
Finders
TopLink
Queries
EJB Entity
Beans
EJB Entity
Beans
JDBC
JDBC
Java
Classes
Java
Classes
ADF Bindings
ADF Bindings
ADF Data Control
ADF Data Control
35
Q U E S T I O N S
Q U E S T I O N S
A N S W E R S
A N S W E R S
36

Anda mungkin juga menyukai