Vous êtes sur la page 1sur 7

25

ADF Controller Flow Scopes Prepared by : Sanjeeb Mahakul

Its a Matter of Scope


This is the most important thing Task flows have a private memory scope PageFlowScope
Plus the usual request, session and application scopes

Accessed via expression language like the other scopes - #{pageflowScope.bean} Private to each flow (and instance of a flow)
This allows nesting and reuse

Data mapped in and out in call activities and task flow returns

ADF Controller Memory Scopes


Application
Attributes and managed beans are available for an entire application and shared among users Information should not have session dependency

Session
Attributes and beans are user instance specific, and exist from the time of their creation to the time they are deleted or the session ends Example usecase is a user info bean that stores information about a user to avoid unnecessary queries

ADF Controller Memory Scopes


PageFlow
Available for the duration of a task flow Exited when exiting the task flow If used with nested task flows, the PageFlow scope of the caller flow is suspended and activated upon return from the called Task Flow PageFlow scope is not available until after the JavaServer Faces Restore View phase

View
Stores objects used by a single page Automatically released when the user leaves the page. A View scope instance exists for each view that the ADF Controller manages The lifetime begins and ends with the change of the view id of a view port

ADF Controller Memory Scopes


Request
Represents the smallest available scope Lasts for the time it takes to transition from one view activity to the next

BackingBean
Special case of request scope Associated with a specific manage bean instance Used with declarative components, regions and page fragments that use a managed bean to hold view state information Allows multiple instances of the component to co-exist on a single page

None
Use for beans that dont require to keep state so that bean does not need to remain in memory

Available Object Scopes


Taskflow Flow Call View Router Method View View

Request Scope Page Flow Scope View Scope Session Scope Application Scope

RS1

RS2

RS3

RS5

PFS1
VS1 S1 A1 VS2

PFS2
VS3 VS4

PFS1

Available Object Scopes


Region View
R D2 D1

View

Router

View

Request Scope Backing Bean Scope Page Flow Scope PFS1

RS1

RS2

RS3

RS4 BBS1 BBS2

PFS2 View Scope VS1 VS2 VS3 Session Scope Application Scope S1 A1 VS4 VS5

Vous aimerez peut-être aussi