oracle adf architecture tv - design - advanced adf task flow concepts

28
1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Upload: chris-muir

Post on 11-Nov-2014

204 views

Category:

Technology


2 download

DESCRIPTION

Slides from Oracle's ADF Architecture TV series covering the Design phase of ADF projects, looking into advanced task flow concepts in ADF applications. Like to know more? Check out: - Subscribe to the YouTube channel - http://bit.ly/adftvsub - Design Playlist - http://www.youtube.com/playlist?list=PLJz3HAsCPVaSemIjFk4lfokNynzp5Euet - Read the episode index on the ADF Architecture Square - http://bit.ly/adfarchsquare

TRANSCRIPT

Page 1: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Page 2: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Real World ADF Design & Architecture Principles Advanced ADF Task Flow Concepts

ORACLE PRODUCT

LOGO

15th Feb 2013 v1.0

Page 3: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Learning Objectives

•  At the end of this module you should be able to:

– Understand the difference between copied and inherited task flow templates, their limitations and use cases

– Understand loose coupling and when it is okay to create dependencies between task flows

– Know about task flow design considerations in terms of granularity and size of individual task flows

– Use bounded task flows as a common language between developers as well as developers and domain experts

Image: imagerymajestic/ FreeDigitalPhotos.net

Page 4: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Program Agenda

•  Task Flow Templates •  Good Task Flow Design Practices •  Highly Reusable Task Flows

Page 5: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Templates

•  Communication –  Use templates to discuss business processes with non-technical domain

experts

•  Reuse –  Use to implement pattern for reoccuring processes

• CRUD • Lookup

–  Use to enforce development standards and good practices

Reuse and Communication

Page 6: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Templates

•  Define common functionality to be inherited by or copied into flows subsequently created bounded task flows

•  Use cases –  Property Settings –  Managed bean definitions –  Exception handling flows –  Logging –  Auditing –  Transaction behavior

•  Templates are either copied into new bounded task flow or referenced

Overview

Page 7: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Templates

•  Template is a "blue print" for a family of related processes –  Bounded task flows built from a template usually need to modify the flow –  Later changes to the template should not be visible in bounded task flow

•  Beware! –  Ensure unique ID in the bounded task flow metadata when copying from

a template to not break MDS functionality

When to Copy from Templates

Page 8: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Templates

•  Template contains common functionality –  Exception handling –  Managed beans –  Task flow entry / exit logging

•  Changes to the template should be immediately reflected in bounded task flows

•  Be aware! –  Before JDeveloper 12c: Activities in the referenced template don't show in visual

editor when designing bounded task flows –  Properties inherited from a referenced template cannot be changed for a task flow

When to Reference Templates

Page 9: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Example: Jobs Task Flow

Page 10: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Tf-fragment-template

Page 11: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Templates

•  Avoid name collisions with consuming task flows •  Collisions will override functionality •  Standardize on template naming schemes for:

–  Activities –  Parameter –  Managed beans

Avoid Pitfalls

Page 12: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Program Agenda

•  Task Flow Templates •  Good Task Flow Design Practices •  Highly Reusable Task Flows

Page 13: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

How granular should our task flows be?

Exercise

Image: imagerymajestic/ FreeDigitalPhotos.net

Page 14: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Design

•  Small task flows: –  Require a lot of calling and maintenance management overhead –  Reasonable sizes for distributed team development –  Provide ultimate flexibility in architecture

•  Large task flows: –  Require less calls and maintenance management overhead –  Less flexible as you can't call discrete functionality within the flow –  Memory footprint likely bigger than small task flows

Task Flow Sizing Considerations

Page 15: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Design

•  Meet in the Middle –  Larger task flows built out of several smaller task flows –  Only top level task flow exposed for reuse –  Encapsulates task flow dependencies

• Good for distributing work among developers • Dependency management "by agreement" in smaller teams • Smaller memory foot print through load-on-demand and task flow

private memory scopes

Task Flow Sizing Considerations

Page 16: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flow Design

•  Think "unit-of-work" and factor task flow functionality into subflows –  Share Data Control frame with sub-flows –  Hide sub-flows from showing in ADF library –  If you cannot fully explain and describe a task flow in 60 seconds it

probably is too big

•  If you save a lot of data in pageFlowScope, keep the task flow small and exit at earliest opportunity

•  Keep task flows that run in their own transaction as small as possible and exit them at earliest opportunity

Sizing Guidelines

Page 17: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

How much should I care for loose coupling?

Exercise

Image: imagerymajestic/ FreeDigitalPhotos.net

Page 18: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Loose Coupling Where Would You Care The Most?

Bounded Task Flow

Task Flow Call Activity

Bounded Task Flow

Task Flow Call Activity

Bounded Task Flow

Task Flow Call Activity

Bounded Task Flow

Task Flow Call Activity

Bounded Task Flow

Task Flow Call Activity

Bounded Task Flow

Task Flow Call Activity

ADF Library

Library internal

Library internal

Library internal

Library internal

Page 19: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Program Agenda

•  Task Flow Templates •  Good Task Flow Design Practices •  Highly Reusable Task Flows

Page 20: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Maximize Reuse

•  Define and configure: –  A set of input parameters that allows you to configure various use cases –  A router activity as the default activity to enable conditional flows –  Dynamic iterator bindings to use a task flow both as a master region or

detail region –  Configure display properties of UI components based on task flow input

parameters

Page 21: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Example 1: Dynamic Task Flow Entry

Page 22: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Example 2: Dynamic Iterator Binding

•  Solution –  Dynamically reference view object instance name from iterator binding

property –  Dynamically generate new View Object instance in ADF Business

Components model •  Use method call activity to invoke View Object instance creation before rendering view •  Use View Criteria to shape query result displayed by View Object

•  What does this help with? –  Allows multiple regions to be added based on the same task flow with

shared data controls configuration –  Each region shows different row data

Use case: Multiple Instances of Task Flow with Shared DC

Page 23: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Multiple Instances of Task Flow with Shared DC

Task Flow

af:region Parent View

Managed Bean Page Flow Scope

View <file>.jsff

<file>PageDef.xml

allEmployeesIterator

allEmployees View Object

Instance Name

Input Parameter

reads from

has "Binds" property set to

Input Parameter

Query argument (e.g. 60 for querying

department 60)

Page 24: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Multiple Instances of Task Flow with Shared DC ADF BC Implementation (AM Impl) public void createUniqueEmployeesVOInstance(Integer departmentId, String instanceName) {

ViewObject existingVO = findViewObject(instanceName); if (existingVO == null) { //create a new view object based on the existing Employees View Object ViewObject newVO = this.createViewObject(instanceName, this.getallEmployees().getDefFullName()); ViewCriteria vc = newVO.createViewCriteria(); ViewCriteriaRow vcRow = vc.createViewCriteriaRow(); //ensure View Object instance returns data specified by the //task flow input parameters vcRow.setAttribute("DepartmentId", "= "+departmentId); vc.addElement(vcRow); newVO.applyViewCriteria(vc); } else { //instance will be reused } }

Page 25: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Conclusion

•  Task Flow templates are blueprints that provide a visual and common language between IT professionals and business domain experts

•  Document task flows using diagram annotations •  Keep task flows "just big enough" but as small as

possible so that task flows that open a separate transaction or task flows that keep large objects in memory are exited early.

Page 26: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Task Flows at the Heart of Oracle ADF

There is nothing more important than understanding task flow-oriented design and architecture when developing Oracle ADF applications

Page 27: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Further Reading

•  ADF Insider –  Task Flow Overview Part 1

•  http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/taskflow-overview-p1/taskflow-overview-p1.html

–  Task Flow Overview Part 2 •  http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/taskflow-overview-p2/taskflow-overview-p2.html

Page 28: Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts

28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.