Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
If we do not find
ADF 101- in a Nutshell anything pleasant, at least
Overview and Hands-on Lab we shall find something new.
Objectives Survey
• Understanding of the ADF development • Languages?
process – PL/SQL
– Lecture sections – Java
– Declarative and visual – Other
• Experience with ADF 12c (current version) • Tools?
– Hands-on lab – APEX
– Labs do not explain “why” or “what” – JDeveloper
• Lectures and book should help
– Eclipse, NetBeans
• About the book
– Developer Forms/Reports
– All 11g concepts in it apply to 12c
– Other
– Much longer hands-on
– You may need to adjust some steps
3 4
Agenda Oracle Application Development
Framework (ADF)
• A framework is a prebuilt service for solving a
• Intros: ADF, sample app, JDev particular problem – like access to the
database
– Code libraries and standards support the framework
• ADF Business Components – Implements code reuse and best practices
– An architecture with code libraries
• ADF is a meta-framework
• ADF Faces – A wrapper for other frameworks
– Available starting in JDeveloper 10g
– Provides a consistent developer experience
• ADF Model and ADF Controller • Pre-ADF available in OAF
Slides will be available on
– Oracle Application Framework (UIX/MVC)
Screenshots are
the NoCOUG and Quovera 11g unless • Based on Model-View-Controller
websites. marked as 12c design pattern (Java EE, SmallTalk)
5 6
Demo 1 11 12
JDeveloper Integrated Development Environment
Data Model
Toolbar
Application
Navigator JSP/HTML Visual Editor
Component
Palette
Log Window
Structure
Window
Property
Also on p. 39 of the lab Inspector
handout and in the sample
app’s UML project. 13
17 18
21 22
23 24
Some Other UI Features Agenda
• Database Utilities
• Debugger • Intros: ADF, JDev, sample app
• UML Modelers
– Class Diagram • ADF Business Components
• For ADF BC, Java Classes, Web Services, Database objects
– Activity Modeler
• ADF Faces
– Use Case Diagram
– Sequence Diagram
• XML Schema Diagram
• ADF Model and ADF Controller
• Integrated WebLogic Server
• Software Configuration Management
25 26
27 28
View Objects = SELECT Read-Only View Objects
• Retrieve data from the database • Each view object instance can execute
• Manage caches of data a SQL query and cache the results.
• View object definitions View object Data
Data
– Contain SQL queries instance Data
Data
View
rows
– Act as templates for view object instances
• View object instances SQL query
Database
Data retrieval
– The “thing” used in code Data
Data
– Technically, an object of the class Data
Data
Data
rows
29 30
31 32
Entity Object Instances Application Modules
• View object instances stores data in entity • Application modules represent the interface from business
components to the application
object instances - view rows point to it – The application always references the application module for data
– Each instance (user) of the application will get its own application
View object Data module instance
Data
instance Data • The application module instance contains the data model
SQL query Data
View
rows – View object instances
– View link instances for master-detail relationships
Database Data retrieval
Data
Data Data
Data Data
Data Dataobject
Entity
Data
Data instances
rows
33 34
Instance of
• UI code will display this attribute
EmployeesView specially
SELECT E.EMPLOYEE_ID,
E.LAST_NAME
FROM EMPLOYEES E
– Pulldown list item loaded with values
– Popup list-of-values dialog
WHERE E.DEPARTMENT_ID = :1
Demo 3
35 36
VO Editor – LOV Subtab Create List of Values
At runtime
37 38
View Criteria
View Criteria in the DCP
• Used for queries
• View Object • Data Controls panel lists
Editor the defined criteria
– 11g Query page • You can drag and drop
– 12c View Criteria a view criteria onto
page a JSF page
• View Criteria
dialog
– Defines the
WHERE clause
declaratively • Components are added for each
– Bind variables attribute in the view criteria
are optional
39 40
Declarative Validation Rules Declarative Validation Benefits
• Simple rules written on the entity object • Quick validation on the app server side
• No Java coding!
• Method 1
• Add a friendlier message for ADF BC-level
– Attributes tab
errors (e.g., length)
– Validation
• Messages stored in a message bundle file
Rules subtab
that you can internationalize
• Method 2 • All UIs built from the entity object will contain
– Business the same validation
Rules tab – Like a trigger in the database
– Attribute or • You need to decide where to place
entity level business rules code
41 42
49 50
Raise 100
0
AutoSubmit true • ADF Business Components
Id TotalPay • ADF Faces
Value #{bindings.Salary
Id Salary .inputValue +
Value #{bindings.Salary.
bindings.Raise.in
putValue}
• ADF Model and ADF Controller
inputValue}
AutoSubmit false
AutoSubmit true
partialTriggers Salary Raise
55 56
ADF Model ADF Data Controls
• Business Services abstraction
• ADF Data Controls
– Makes Model components available to
– Provides list of components The Good News:
ViewController You don’t
or groups of components for normally write
a node in the data model – Automatically created with ADF BC data controls
– “Drop as” options – Can be created for other business services
– For non-ADF BC, defined in DataControls.cpx
• ADF Bindings
• Provide list of “Drop as” options that create
– Prebuilt connection from
the ADF BC to the UI pre-bound components
– Drag and drop action – Collection level (view object instance)
above does the work – Attribute level (view attribute)
57 58
61 Demo 5 62
63 64
Attribute Bindings and JSF Binding File
• The page definition (or PageDef) XML file
• You can access attribute bindings from stores binding definitions for the page
any component attribute – One PageDef file for each JSP
<af:outputText value="#{bindings.DepartmentId.inputValue}" /> – Called filenamePageDef
• Other attributes access properties on – For example; editEmployeePageDef.xml
the Model level object • Created when you drag a data control to
– Control hints or attribute properties (for the page the first time
example, label and width): – You can create the file manually
<af:inputText • Maintained as you drag or delete
value="#{bindings.PhoneNumber.inputValue}"
label="#{bindings.PhoneNumber.label}" components
columns="#{bindings.PhoneNumber.displayWidth}"/> – You can edit manually
65 66
67 68
Sample ADF Controller Sample ADF Controller Code
Development <task-flow-definition id="dept-flow">
<default-activity>deptBrowse</default-activity>
<view id="deptBrowse">
exception handler <page>/deptBrowse.jspx</page>
</view>
<view id="deptEdit">
control flow case <page>/deptEdit.jspx</page>
router </view>
<control-flow-rule>
<from-activity-id>deptBrowse</from-activity-id>
<control-flow-case>
<from-outcome>toEdit</from-outcome> From
<to-activity-id>deptEdit</to-activity-id>
</control-flow-case> To
</control-flow-rule>
<router id="checkForExplicitID">
<case id="__6">
<expression>#{!empty pageFlowScope.employeeId}
</expression>
<outcome>byId</outcome>
</case>
<default-outcome>currentUser</default-outcome>
</router>
start point <method-call id="queryEmployeeById">
of the flow. <method>#{bindings.queryEmployeeById.execute}</method>
<outcome>
<fixed-outcome>queryEmployeeById</fixed-outcome>
</outcome>
69
</method-call>
Demo 6
71 72
Summary Designer
Developer
Advanced
Forms & JDeveloper 3
• Books co-authored with Dr. Paul
Handbook Reports Handbook
Dorsey, Avrom Roy-Faderman, &
• Oracle is building Fusion Applications with an Duncan Mills
ADF core technology stack
• ADF offers a consistent developer ORACLE9i
JDeveloper
Handbook
ORACLE
JDeveloper 10g
Handbook
experience regardless of the technologies
• ADF Business Components provide access www.quovera.com
to the database and other data sources • Founded in 1995 as Millennia Vision
Corp.
• ADF Model connects ADF BC to ADF Faces • Profitable without outside funding
• Consultants each have 10+ years
• ADF Faces provide 150+, feature-rich item industry experience
and container components for JSF pages • Strong High-Tech industry background
• 200+ clients/300+ projects
• ADF Controller manages page flow • JDeveloper Partner
and task flow • More technical white papers and
presentations on the web site
73 74