reuse in adf applications

25
Reuse in ADF applications June 2nd 2016. Matthieu de Graaf & Frank Houweling Write once, Use everywhere

Upload: matthieu-de-graaf

Post on 16-Apr-2017

65 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Reuse in adf applications

Reuse in ADF applications

June 2nd 2016. Matthieu de Graaf & Frank Houweling

Write once, Use everywhere

Page 2: Reuse in adf applications

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

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

[email protected]

Page 4: Reuse in adf applications

Matthieu de Graaf

• Principal Java / ADF consultant - AMIS (Netherlands)

• Focus on ADF/Database and .Net (WPF) Development

• Not so frequent speaker

[email protected]

Page 5: Reuse in adf applications

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

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

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

8

TaskflowBean: Utility Functions

• Contains general utility functions

– Example refresh of UI components

Page:

Bean:

this.refreshPageComponent(“buttonbarPanel");

Page 9: Reuse in adf applications

9

TaskflowBean: Container for behaviour of declarative components

• Container for (declarative) components

Page 10: Reuse in adf applications

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

12

Example declarative component

• CrudPanel: For Inserting, editing and deleting occurences – Edit link default not shown

Page 12: Reuse in adf applications

13

CrudBean: Add Part in the library

Page 13: Reuse in adf applications

14

Crud Actions: non default behavior

Page 14: Reuse in adf applications

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

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

17

Reuse in the model layer

• Generate sequence values

• Call stored procedures/functions

• Set page in readonly mode

Page 17: Reuse in adf applications

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

19

Generate sequence in ADF

• Override EntityImpl: initDefaults method

Page 19: Reuse in adf applications

20

Call stored procedures

• Override ApplicationModuleImpl

Page 20: Reuse in adf applications

21

Make a page readonly

Page 21: Reuse in adf applications

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

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

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

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