Reuse in adf applications
-
Upload
matthieu-de-graaf -
Category
Software
-
view
65 -
download
0
Transcript of Reuse in adf applications
![Page 1: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/1.jpg)
Reuse in ADF applications
June 2nd 2016. Matthieu de Graaf & Frank Houweling
Write once, Use everywhere
![Page 2: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/2.jpg)
2
Content
• Short introduction into Oracle ADF
• Reuse in Taskflows
• Reuse in the UI layer– Crud actions– Dynamic Save/Rollback buttons
• Reuse in the model layer– Selection of sequences– Executing database procedures– Make a screen readonly in seconds
• Final example– Global search out of the box
![Page 3: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/3.jpg)
Frank Houweling
• Principal Java / ADF / SOA consultant - AMIS (Netherlands)
• Focus on performance diagnosis & performance management
• Frequent speaker at Kscope, UKOUG and OOW
• Tech Lead of ADF Performance Monitor
![Page 4: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/4.jpg)
Matthieu de Graaf
• Principal Java / ADF consultant - AMIS (Netherlands)
• Focus on ADF/Database and .Net (WPF) Development
• Not so frequent speaker
![Page 5: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/5.jpg)
5
Short introduction into Oracle ADF
Application
Module
ViewController Part
Model Part
Taskflow
View Objects
Entity Objects
Application Module
Page(fragments)
Beans
Database
UI description
Dynamic behavior of UI
Business data, retrieves data
Interface to the outside world
Interface to the ViewControllerTransaction management1:1 presentation of the database tables in the java world
![Page 6: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/6.jpg)
6
Reuse in the UI Layer: Taskflowtemplates
• By means of taskflow templates
• Default Structure
• Error handling
• Close actions for a popup
![Page 7: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/7.jpg)
7
Reuse in the UI layer: TaskflowBean
Library Module
TaskflowBean
Taskflow
ModuleBean
taskflowBean
Is instantiated in
Is subclassed in
![Page 8: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/8.jpg)
8
TaskflowBean: Utility Functions
• Contains general utility functions
– Example refresh of UI components
Page:
Bean:
this.refreshPageComponent(“buttonbarPanel");
![Page 9: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/9.jpg)
9
TaskflowBean: Container for behaviour of declarative components
• Container for (declarative) components
![Page 10: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/10.jpg)
10
Container for declarative components – pattern
Library Module
DeclCompBean
Page
TaskflowBean
Binds to
Declarative component
Can be subclassed inModuleDeclCompBean
Binds to
Is used inMy
Declarative component
Default behavior
Module specific behavior
![Page 11: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/11.jpg)
12
Example declarative component
• CrudPanel: For Inserting, editing and deleting occurences – Edit link default not shown
![Page 12: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/12.jpg)
13
CrudBean: Add Part in the library
![Page 13: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/13.jpg)
14
Crud Actions: non default behavior
![Page 14: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/14.jpg)
15
TaskflowBean: Enabling/Disabling Save/Cancel buttons
• Enabling/Disabling of save/cancel buttons depending on the dirty state of the Datacontrol associated with the taskflow
No changes to be saved
Changes
![Page 15: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/15.jpg)
16
TaskflowBean: Enabling/Disabling Save/Cancel buttons
Library Module
Taskflow
PageLifeCycleBean Page
RibbonSavePanelcomponent
Label
Autosubmit is true
Evaluates #{pageFlowScope.taskflowBea
n.isDataControlDirty
taskflowBean
Refreshes the panel surrounding the save/Cancel
buttons
SaveBean
![Page 16: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/16.jpg)
17
Reuse in the model layer
• Generate sequence values
• Call stored procedures/functions
• Set page in readonly mode
![Page 17: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/17.jpg)
18
Reuse in de model layer
• Use Subclasses of the standard Entity/ViewObject/ApplicationModule classes
Class Subclass of object Subclass of row of Object
ApplicationModule ApplicationModuleImpl -
Entity EntityImpl
ViewObject ViewObjectImpl ViewObjectRowImpl
![Page 18: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/18.jpg)
19
Generate sequence in ADF
• Override EntityImpl: initDefaults method
![Page 19: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/19.jpg)
20
Call stored procedures
• Override ApplicationModuleImpl
![Page 20: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/20.jpg)
21
Make a page readonly
![Page 21: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/21.jpg)
22
Make a page readonly
Library Module
ViewObjectRowImplTaskflow
taskflowBean
page
ViewObjectImpl
UpdateModeProperty
attributeUpdatable Property
Sets the attributeUpdatable
Property
UpdateMode prop.
Iterator prop.
![Page 22: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/22.jpg)
23
Reuse in UI and Module layer working together: Global search
• Purpose: 1 Search field queries all columns in a viewObject with wildcards
![Page 23: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/23.jpg)
24
Global search: Pattern
Library Module
Taskflow
taskflowBean
Calls the viewObject by iterator name
ViewObjectImpl
Puts custom viewCriteria on the
ViewObject and query
searchBean
IteratorName
pageSearchPanel
![Page 24: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/24.jpg)
25
Conclusion
• In Oracle ADF you can accomplish reuse in a lot of ways
• Switch from declarative approach to a code approach
• Your application– Will have consistent look and feel– Will take less time to develop– Can be maintained easier
![Page 25: Reuse in adf applications](https://reader036.fdocuments.in/reader036/viewer/2022081605/58f28d281a28ab43458b4571/html5/thumbnails/25.jpg)