Oracle ADF Interview Questions and Answers

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

ORACLE APPLICATION

DEVELOPMENT
FRAMEWORK (ADF)
Questions and Answers

Author: Deepak Bhagat


Fusion Functional Consultant,
Solution Architect & ADF Trainer
Oracle Application Development Framework (ADF) Questions and Answers

Table of Contents
1 Overview of Fusion Middleware and ADF ........................................................ 1
2 Understanding Development Tool: JDeveloper ................................................ 5
3 Modeling Database Schema ........................................................................... 7
4 Building Business Service with Default ADF Business Components.................... 8
5 Persisting Data using Entity Object................................................................10
6 Querying Data using View Object ..................................................................12
7 Exposing Business Service through the Application Module .............................16
8 Declaratively Customizing Business Services ..................................................18
9 Validating Business Services .........................................................................20
10 Introducing User Interface Technologies .......................................................23
11 Getting Started with Rich User Interface ........................................................25
12 Planning Pages using Layout Components .....................................................27
13 Designing User Interfaces and Page Flows.....................................................28
14 Interactively Controlling with Navigation Components ....................................31
15 Ensuring Reusability in Web Applications .......................................................32
16 Working with Scopes, Parameters and Partial Page Refresh ............................34
17 Responding to Managed Beans, Events and Listeners .....................................37
18 Binding Model Layer with Business Services and Databound View ...................42
19 Querying Data with Search Components ........................................................42
20 Implementing Transactions ..........................................................................42
21 Understanding Data Controls and Bindings ....................................................43
22 Programmatically Customizing Business Services............................................48
23 Deploying ADF Applications ..........................................................................49
24 Securing ADF Applications ............................................................................49
25 Debugging and Troubleshooting ADF Applications ..........................................50
26 Best Practices ..............................................................................................51
27 Miscellaneous Topics ....................................................................................52
28 Advance Topics ............................................................................................54

i
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

1 Overview of Fusion Middleware and ADF


1. Explain Fusion Middleware architecture

2. Explain MVC architecture

1/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

3. How does ADF fall in MVC architecture?


Oracle ADF Architecture is based on the Model-View-Controller (MVC) design pattern. MVC consists
of three layers which are model layer, view layer, controller layer. Oracle ADF implements MVC
and further separates the model layer from the business services to enable service-oriented
development of applications.
The Oracle ADF architecture is based on four layers:
The View layer: This layer provides the user interface of the application. ADF components
comes in this section are jsff, jspx page.
The Controller layer: This layer provides a mechanism to control the flow of the Web
application. ADF Component comes in this section are Task flows (Bounded and unbounded,
faces-config.xml, adfc-config.xml)
The Model layer: This layer provides an abstraction layer on top of the Business Services
layer, enabling the View and Controller layers to work with different implementations of
Business Services consistently. ADF Component comes in this section are Page Definition,
Data Bindings, Data Controls (Application Module Data Control, Web Service Data Control)
The Business Services layer: This layer provides access to data from various sources and
handles business logic. ADF Component comes in this section are View Object, Entity Object,
View Link, Association, etc.

4. What is Oracle ADF?


Oracle Application Development Framework, usually called Oracle ADF, provides a commercial
Java framework for building enterprise applications. It provides visual and declarative approaches
to Java EE development. It supports rapid application development based on ready-to-use design
patterns, metadata-driven and visual tools.

5. What are the various components in ADF?


Oracle ADF has the following components:
ADF View: JSP, JSF, ADF Faces etc.
ADF Controller: Task Flows, Managed Beans
2/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

ADF Model: Data Binding (.cpx, .xml) & Data Controls (.dcx)
ADF Business Components: VO, EO & AM

6. What is the ADF Controller?


ADFc: The controller component in ADF is an extension of the JSF navigation model and promotes
modularization and reuse. Besides, ADFc provides declarative transaction handling and clearly
defined process boundaries.

7. What is the ADF Model?


ADFm: The binding layer and model are represented by data controls and the binding container
object. ADFm is built on JSR-227 and abstracts the view layer model access from the
implementation details of the underlying business service.

8. What is ADF Desktop Integration?


ADFdi Desktop integration with Microsoft Office 2007 allows developers to access the
Server-side ADF binding layer from Excel workbooks.

9. What are the advantages of using ADF?


It supports Rapid Application Development.
It is based on MVC architecture
Declarative Approach (XML Driven)
Secure
Reduces maintenance cost and time
SOA Enabled

10. What are the advantages of ADF over J2EE?


Category Struts / Spring Framework Oracle ADF Framework
Framework Action-based Component-based
Source code The developer has to write source Built-in UI components and Rich look
code for all the UI components & feel
Database The developer has to explicitly write Built-in configuration of database
connection Database connectivity code to connectivity, no explicit retrieval
retrieve connection required
SQL The developer has to write SQL The declarative approach builds the
Statements statements and execute them required SQL statements
Transactions The developer has to take care of Transactions are managed by the
Transaction management framework
Page Page navigations are based on the The controller takes care of page
navigation config XML files which should be navigations when declaratively given
taken care of by the Developer
Validations Each validation should be written in Sophisticated validation hookups
validation logic specific methods and provided by ADF at various levels: UI
each validation error should be level, AM Level, and Entity-Level; the
managed separately and navigated developer can decide the right place of
to respective error pages validation for a scenario

3/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

Security User has to design and develop a A declarative approach to security


user login UI page enables the developers to provide
security at various levels: to pages,
regions, tabs, sections, components
Development To build a normal CRUD operation To build a normal CRUD operation
Time module, developers take 3 days on module, developers need 10 minutes
an average on an average, having proper AM, EO,
VO configured
Authentication The developer has to verify Though it is not a direct feature of
username and password against the ADF, Weblogic provides various ways
data source provided to authentication to which an ADF
application can easily be coupled with
SQLAuthentication,
SAMLAuthentication,
LDAPAuthenntication, etc

Wizard Developers find hardly any wizards ADF is all about wizards and when
to help in building framework users make proper use of these
features wizards, they make the application
work for the business requirements—
and ADF provides all the source code

Servers The framework can make use of Built-in Weblogic server configurations
web application servers like Apache make deployment much easier
Tomcat, Websphere, JBoss, etc.

4/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

2 Understanding Development Tool: JDeveloper


11. Overview of Development tool (JDeveloper)

12. How do you set the Development environment (IDE) preferences?


Access the Preferences window by selecting Tools > Preferences

5/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

13. List some of the windows in JDeveloper


Applications
Data Control Panel
Database
Structure
Editors (code or visual)
Log and Debugger
Components
Resources (IDE and Application)
Properties
Other Windows

6/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

3 Modeling Database Schema


14. In how many ways in which one can work with database objects in JDev?
You can work with database objects in the following ways:
Online: Create and modify schema objects directly in a database through a JDeveloper
connection.
Offline:
 Model metadata for database objects outside the context of a database schema.
 Import objects from the online database.
 Generate changes to online schemas.
Diagrammer:
 Create and modify objects by dragging from Component Palette and Database
Navigator.
 Import objects from the offline database model.
 Generate changes to online schemas.

7/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

4 Building Business Service with Default ADF Business Components


15. What is ADF BC (Business Components)? Describe them.
ADF Business Components provides a foundation of lightweight Java classes and XML metadata
configuration files for building database-centric business models that include business logic,
validation, queries, transaction handling, and data access.
Entity Object: An entity object represents a row in a database table and simplifies
modifying its data by handling all DML operations for you. It can encapsulate business logic
for the row to ensure your business rules are consistently enforced. You associate an entity
object with others to reflect relationships in the underlying database schema to create a
layer of business domain objects to reuse in multiple applications.
View Object: A view object represents a SQL query and simplifies working with its results.
You use the full power of the familiar SQL language to join, project, filter, sort, and aggregate
data into exactly the “shape” required by the end-user task at hand. This includes the ability
to link a view object with others to create master/detail hierarchies of any complexity. When
end users modify data in the user interface, your view objects collaborate with entity objects
to consistently validate and save the changes.
Application Module: An application module is a transactional component that UI clients
use to work with application data. It defines an updatable data model and top-level
procedures and functions (called service methods) related to a logical unit of work related
to an end-user task.

16. What are the different types of Business Components?


Entity Object (Data Persistence Business Object)
 Java
 PL/SQL
 Association
View Object (Data Query Business Object)
 Read-only
 Updateable
 View Link
8/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

Application Module
 Business Service
 Service Data Object

9/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

5 Persisting Data using Entity Object


17. What is Entity Object?
Java object that represents a row in a database table. It automatically handles data validation,
storage, and persistence.

18. Can an entity object be based on two Database Objects (tables/views)


or two Web services?
No entity objects will always have one to one relationship with a database object or web service.

19. Can we have entity objects to inherit from one another? If yes, how?
Entity objects use a single table per hierarchy approach while implementing multiple-inheritance.

20. Does EO have Primary Key if the DB table doesn’t have Primary Key?
Yes, creates one from RowID

21. What is Polymorphic EO?


EO inherited from custom based EO are Polymorphic EO. Example: CarsEO and BusEO inherited
from VehicleEO are Polymorphic EO

22. What is the Polymorphic Discriminator attribute in EO?


To identify the attribute as a discriminator column for polymorphic entity objects. Example:
‘VehicleType’ attribute in CarsEO and BusEO identifies itself as Polymorphic Discriminator attribute

23. Explain various types of Updatable attribute


Always: Makes an attribute updatable
While New: Makes an attribute updatable before an entity is first posted. Example:
EMPLOYEE_ID (Primary Key)
Never: Makes an attribute read-only. Example: Transient attribute ‘AnnualSalary’

24. Give an example of Transient attribute


A calculated attribute not associated with the DB column is a Transient attribute. Example:
AnnualSalary

25. Explain Queryable attribute


An attribute can occur in the WHERE clause of a view object (selected by default except for LOBs)

26. Explain Change Indicator


Indicates, if the column is a change indicator, such as a timestamp, to be used to indicate that a
row has been changed by another transaction or can be locked. If no columns are specified as
change indicators, ADF BC does a column-by-column comparison

27. What does the EO do with DB constraints?


Creates implicit validators for database constraints

10/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

28. What is Association in ADF?


Association represents the relationship between 2 and more tables like a foreign key relationship.
If you create Entities from the database association will automatically get created for the entity.
Users can also define custom association if there is no foreign-key is defined in the database. In
this way, the user can handle foreign keys in the ADF application and can remove overhead from
the database.

29. Explain different types of Associations?


Association (non-dependent)
 Entities are related but not completely dependent
 Either end of the association can exist without the other
 Either can be deleted without deleting the other

Composition (dependent)
 Destination entity is completely dependent on source entity
 Source entity owns destination entity
 No destination entity can be created without the owning entity existing first
 Source entity cannot be deleted without deleting all its associated destination entities

11/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

6 Querying Data using View Object


30. What are the different types of View Objects?
Static View Object: While defining the user will define an attribute for view and later, he
has to provide the values for those attributes. This kind of view object will have fixed no of
rows.
SQL Based View Object: These View Objects are based on SQL queries. These view
objects will have an underlying SQL Query. At runtime, they will hold data return by SQL.
Programmatic View Object: User can define the view attribute while defining a view
object. Data will insert programmatically into these View Object.
Entity-Based View Object: These view object will hold the reference of the underlying
entity. These view objects can hold data from single or multiple entities. While defining View
Object based on Entity you can select the attribute which you want to keep in the entity.

12/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

31. What is the View Object?


A query definition that provides data based on SQL queries, programmatic Java, and stored
procedure access and static lists. SQL query-based view objects that reference one or many entity
objects make the query result updateable, allowing Data Manipulation Language (DML)
operations. A set of one or more view objects used in an application module defines the business
service access layer.

32. Can Query-based VO update data in the database?


No, SQL query-based VO is read-only.

33. Explain how a VO based on EO retrieves data?


The view object queries the database directly
Data retrieved by the query is saved to the Entity Object’s cache. (View Object instead of
caching data themselves, stores in Entity Object instances.)
Non-persistent attributes are stored and retrieved from the view object’s cache

34. Explain how a VO based on EO update data?


The view object updates the entity object’s cache
The entity object instances write back (commits) to the database
Entity object definitions can specify validation rules

13/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

35. How do you make a join VO referenced or updatable?


Referenced

Updatable

14/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

36. Differentiate between Join VO based on Referenced EO and Updatable


EO?
Reference Entity is the most commonly used way to get information from other entities for display
purpose and is in read-only mode whereas Updateable Entity allows data to persist into the data
source.

37. What is View Link?


Relations that are based on entity associations or defined manually, providing master-detail
coordination between view objects.

15/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

7 Exposing Business Service through the Application Module


38. What is the Application Module?
One or more modules that expose the data model based on the defined view objects and their
relations. The root application module represents the transaction context on which commit and
rollback operations are executed

39. What is Nested AM?


Can contain other application modules, called nested application modules
Root AM provides transaction context, DB connection, and a single set of entity caches
It combines VOs and service methods

40. What is AM Instance?


Each instance (user) of the application will get its own application module instance
The application module instance contains view object instances
View object instances use entity object instances to write

41. What is the Data Model?


The view object instances in an application module instance are joined in master-detail
relationships by “view link instances”
The resulting tree is called the “data model”

42. What is AM Passivation?


AM passivation saves transaction state in an XML document stored in a database

16/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

43. What is AM Activation?


AM activation retrieves saved transaction state

44. How does AM manage Application State?


AM passivation saves transaction state in an XML document stored in a database
AM activation retrieves saved transaction state
Passivation and activation are performed automatically when needed

45. Which component in ADF BC manages transactions?


Application Module manages the transaction.

46. Why we used an application module in the ADF framework?


AM is the component of ADF BC which holds the references of View Object and instantiates them
while running the application. View Object reference defines in the Application Module can be used
to define the jsff/jspx page. If you want to use any View Object on your page you must have to
provide the reference in Application Module.

17/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

8 Declaratively Customizing Business Services


47. What's the difference between View Criteria and Where clause?
A View Criteria is a filter that you apply programmatically or by definition to a View Object instance.
It augments the WHERE clause in a View Object query. Named View Criteria are defined in the
Query panel of the View Object and are used
In combination with the af:query component to building search forms. To do this, you
drag and drop the View Criteria from the Named View Criteria node of the View Object in
the Data Controls Panel. In the context menu, you then select the Query component -
optionally with a result table
To restrict a View Object instance in the Application Module model. For this, select a View
object instance in the right-hand list of the ADF Business Component Data Model panel. Use
the Edit button to add a View Criteria to the View Object instance. This ensures that the
View Object instance also runs with a query filter applied.
View Criteria use bind variables for query conditions that you want to pass in dynamically at
runtime. Besides the ability to apply View Criteria declaratively, you can apply them
programmatically in Java.
A WHERE clause, if added to a View Object query by design restricts all instances of this View
Object, which usually is not what developers want. Because of the benefits and the
configuration options not explained above but in the product documentation referenced
below - the recommendation is to use View Criteria.

48. What is Groovy?


Is a Java-like scripting language that is dynamically compiled and evaluated at run time
Enables to use declarative expressions, instead of writing Java code, for the following types
of values in the ADF BC data model:
 Bind variables
 Calculated attributes
 Attribute default values
 View criteria
 View accessor bind variables
 Validation
 Validation message token binding

18/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

49. Explain various customization of EO’s default behavior?


Alternate key entity constraints
Customize attribute control hints
 Example: HireDate – Simple Date
Synchronize columns with trigger-assigned values
Validate user input

50. Explain various customization of VO’s default behavior?


Define attribute control hints: HireDate – Simple Date
Perform calculations: Add transient attribute:
 Example: AnnualSalary – 12*salary
Projection: Restrict the columns retrieved by a query:
 Example: select FIRST_NAME, LAST_NAME from employees
Sorting: reorder of queried rows using ORDER BY clause:
 Example: select * from employees ORDER BY LAST_NAME
Selection: Restrict the rows retrieved by a query:
 Where clause
 Example: select * from EMPLOYEES WHERE email = ‘SKING’
 Parameterized where clause with bind variable
 Example: select * from employees WHERE email = :p_email
 Structured where clause (view criteria)
 Parameterized structured where clause (Example: p_manager_id)
Define a list of values (LOV)

51. What is View Accessor?


View accessors are used for validation and LOVs
You create them on the View Accessors page of EO or VO editor

19/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

9 Validating Business Services


52. Where is that we write business rules/validations in ADF and why?
We should ideally be writing validations at the Entity Object level because they provide the highest
degree of reuse.

53. What is the difference between the primary key and a unique key?
Primary Key:
Can be only one in a table
It never allows null values
Primary Key is a unique key identifier and cannot be null and must be unique.
Unique Key:
There can be more than one unique key in one table.
Unique key can have null values
It can’t be candidate key
Unique key can be null and may not be unique.

54. Give an example or use case of a single attribute validation?


Use Case: Validate Job Id
Triggered when attributes are set

55. Give an example or use case of a cross attribute (Entity-Level)


validation?
Use Case: Validate Total Salary of all Employees in a Department
Triggered because of page submit and before a transaction is committed

56. Give an example or use case of a transaction level validation?


Use Case: Create a limit of the total salary of all employees in a department. The total salary
of all employees in a department should not cross a threshold value
Executed only once for all entities in the transaction of the same type, rather than once per
entity.

57. Give an example or use case of a cross-entity validation?


Use Case: Before deleting department, validate that all there is no employees associated
with the department
Unrelated entities refer to each other during the validation phase

58. Difference between Attribute and Entity level validator?


Attribute level Validation:
 Attribute-level validation rules are enforced when the user changes the value of the
related attribute
 Limitations: Binding does not happen at the view accessor level
Entity-level Validation:
 Entity-level validation rules are enforced when a user tries to commit pending changes
or navigates between rows
 If the validity of one attribute is dependent on one/more other attributes, then the best
practices would be to enforce this rule using entity validation, not attribute validation
 Entity object validators are triggered whenever the entity, as a whole, is dirty

20/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

59. Give an example or use case of a unique key validation?


Use case: Employee email is Unique
Ensures that the attribute always has a unique value if present is defined at the entity level
Ensures that primary key values are always unique
Can also be used for alternate keys
Upon failure, throws TooManyObjectsException

60. Give an example or use case of a compare validation?


Use case: Hire Date to be less than or equal to Current Date
Compares an attribute to a value

61. Give an example or use case of a collection validation?


Use case: Total salary of all employees
Performs validation based on aggregate functions (sum, average or count of an attribute
value) over all rows in a table
Is defined at the entity level

62. What is the difference between Entity and View Accessor in Key Exists
validator?
Use Case:
 Validate Employees and Departments
 Validate Jobs
Validation Target Type:
 Entity: If the two tables are related and there exists an association between the two
 View Accessor: Tables are not related or the result set comes from a query

63. Give an example or use case of a length validation?


Use case: The phone number field is not less than 10 characters
Compares the character or byte length of an attribute to the specified value

64. Give an example or use case of a list validation?


Use case: Validate JobId
Compares an attribute against a list of values

65. What is the difference between List validator and Key Exists validator?
Use Case:
 Validate Jobs (List Validator)
 Validate EmployeeByEmail (Key Exists Validator)
Validation Rule Type:
 List Validator should be used typically when
 The query results are small as the results are cached
 There are no bind variables in the query
 The query does not have to be executed again in the same transaction
 Key Exists Validator List should be used typically when
 The query uses a bind value in the query and hence needs to be executed every time
as needed
 The bind value is required in the query as otherwise, the result set may be quite large

21/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

66. Give an example or use case of a regular expression validator?


Use Case: Validate email address, URL value
The expression validator is similar to the method validator, except that the code is written
in Groovy expression language
Capable of calling another java method within Groovy expression

67. Give an example or use case of a range validation?


Use case: Salary range should be between 0 to 99999
Compares an attribute to a range of values

68. Give an example or use case of a method validator?


Use Case: Validate HireDate
Extend declarative rules for entities or attributes
Call Java methods in your entity object (not in a separate class as a global rule is)
Are called automatically during validation cycle
Custom entity method with signature: "boolean validateXXX()"
Should be used only if the declarative approach is not available
Used to implement complex validations and for derivations
Must:
 Be defined as public
 Return a boolean value
 Be named like validateXXX()

69. Explain Domain (Custom data type)?


Domains are Java classes that extend the basic data types (String, Number, Date, and
so on)
You can create your own data types that encapsulate specific validation rules
Use domains for more complex validation:
 Format of a phone number
 The validity of a URL
 The validity of an email address
 The checksum of digits of a credit card number
Validation is done by the domain constructor
The domain is not bound to a particular entity or attribute

70. What are the two failure severity levels for error messages?
Error
Informational Warning

22/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

10 Introducing User Interface Technologies


71. Compare JSF against Traditional JSP?

72. Explain JSF Lifecycle Phases?


Request processing is managed by FacesServlet, which creates the FacesContext
object
When a client makes a request for the page, the life cycle starts
During the life cycle, JSF implementation builds the view (tree of UI components) while
considering the state saved from the previous postback
When the client performs a postback of the page, JSF implementation must perform life-
cycle steps:
 Conversion
 Validation

23/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

73. What are Renderers?


Converts components to and from a specific markup language
Display UI components in a technology understood by the output device
Display in different forms based on the invocation
 Example: UIOutput -> text label, date label.
When an item has focus, its highlighting looks different depending on the client

74. What are the Renderer Kits?


Library of Renderers
Basic HTML RenderKit is part of the specification (reference implementation)
Enable the same component to be rendered differently depending on the client

75. What are the types of ADF Faces components?


ADF Faces components may be broadly categorized as:

24/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

11 Getting Started with Rich User Interface


76. What is the Resource Bundle?
Resource bundles are simple properties files that contain the translatable strings used in an
application
Translation strings can be parameterized to dynamically include strings like exceptions or
counter
You do not need to load the base resource bundle on each page of your application

77. What are the different kinds of resource bundles supported in ADF?
ADF supports different types of resource bundle which are as follows:
Property file-based (text file which contains key-value pair)
Xliff file-based (XML file which contains key-value pair)
List Resource bundle

78. How to provide a separate resource bundle for each jsff/jspx?


Go to Project Properties > select Resource Bundle and select One Bundle per file.

79. What is <f:facet> ?


This tag is used to add a facet to the component means this tag is used to add its child as a facet
of the closest parent component. With the help of this tag, we can add header and footer facet to
the container component like panelGroup. This tag contains one attribute:
name: This is the required attribute and is used to set the name of the facet. "header" and "footer"
values can be used for this attribute.

80. In which XML do you configure the skin for your framework application?
trinidad-config.xml

81. What is the difference between trinidad.config and trinidad.skins?


trinidad.config file is created when you create a WebCenter portal application. This is
used to register the skin-family you are going to use for your entire application.
trinidad.skins is used when we use the skin as a Jar file. This file provides a mapping
between the Skin Id and the actual path where the skin exists.
25/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

82. Explain about web.xml?


Standard J2EE deployment descriptor
Registers JSF Servlet (FacesServlet)
ADF Filter
ADF Resources Servlet
ADF Bindings Filter
Context param to identify CPX file

26/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

12 Planning Pages using Layout Components


83. What is the difference between jspx and jsff?
jspx and jsff file are the same in most of the manner. The only difference is that you can run jspx
directly on the browser while jsff file container which will run on the browser.

84. What is the difference between visible property and render property?
The visible property is set to true/false based on the requirement whether we want to see the
field on the page or not at run time. The field or component still exists on the page, though hidden.
The render property is used to conditionally load the component based on criteria.

85. List the layout components that cannot stretch?


panelBorderLayout
panelFormLayout
panelGroupLayout (default/horizontal)
panelLabelAndMessage
panelList
showDetail
tableLayout

86. What is Active Geometry management?


Determines how best to make use of available screen real-estate
The framework
 Notifies layout components of browser to resize activity
 Layout components, in turn, resize their children
This allows certain components to stretch or shrink, filling up any available browser space

87. Why you should avoid changing styles like inlineStyle or styleClass?
Changing styles (e.g. inlineStyle or styleClass) can impact the ability for a component to
stretch or flow. Don’t modify styles; instead, solve problems using a declarative approach to
insulate you from browser-specific issues

88. How do you define pagination in ADF?


We define custom pagination in ADF by creating a custom table as a task flow using the
af:iterator tag. This renders the collection of data just as a table renders it. Now we bind the
value property of iterator to collection model from ADF bindings declaration and set the number
of visible rows to, say 15.

27/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

13 Designing User Interfaces and Page Flows


89. What is Task flow?
Task flow is the controller of an ADF application, it provides us a declarative approach to define
the control flow. It is used to define the navigation between pages and various task flow activities.
Task flows pass the control not only between the JSF page but also between other activities, for
instance, method calls or other task flows.

90. What is task flow? How many types of task flows ADF support?
Task flow is the Component of Oracle ADF which is used to define the simple task after successfully
defining task-flow can consume any number of times.
ADF supports two kinds of task flow:
UnBounded Task flow:
 Can directly run on the browser
 The first entry on task flow stack—the outermost task flow
 No well-defined boundary or single point of entry
 Use an unbounded task flow if your application has multiple points of entry
 Can be used to define the “top level” flow of an application
 Bookmarkable pages
 The source file is adfc-config.xml
Bounded Task flow:
 Require the page on which they will consume
 Single point of entry
 Well-defined boundary
 pageFlow Memory scope
 Declarative transaction management
 Declarative Back button support

91. What is the behavior of the router in the ADF task flow?
Based on some condition router can decide which route needs to be followed. If none of the
condition match in that case router will follow the default route defined by use.

92. How to initialize ADF Task flow?


Open the task flow in Overview Mode select General option, there is initializer property. You can
provide any method reference which will get invoked whenever the task flow instance created.

93. Can bounded task flow run on the browser?


No.

94. What are entry points for task flow (TF)?


This TF contains several view activities that are all entry points to the application.

95. How one bounded task flow can call another?


One task flow can call another bounded task flow using a TF call activity or a URL.

96. Can ADF task flow hold more than 1 view activity?
Yes. ADF task flow can have multiple view activity but 1 activity has to be defined as the default
activity.

28/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

97. What is the difference between Bounded and Unbounded task flows?
Unbounded Bounded

The first entry on task flow stack Added to task flow stack when called

No well-defined boundary or single point Single point of entry, with zero or more exit
of entry points

Cannot be used as a region on a page Can be used as a region on page with page
fragments

Does not accept parameters Accept parameters and return values

Not securable on its own; uses page Can be secured separately from pages
security
Cannot manage transactions or save for Declarative transaction management, save
later for later

Cannot be called Must be called to be invoked

Can be bookmarked Not bookmarkable

Can directly run on the browser Cannot directly run on the browser

98. Explain the purpose of using Control flow in ADF?


Control flow defined in task flow can be called anytime from any page of that task flow. If you
have the same flow for multiple pages just define the control flow once in the task flow. You can
invoke it anytime from any action event.

99. What is the Parent Action in ADF Task flow?


Parent action is an activity using that you can invoke the Control flow define in parent task flow
from child task flow. More details can be found on the Parent Activity.

100. Difference between JSF Page Flow & ADF Task Flow?
JSF Page Flow:
The entire application must be represented in a single page navigation file (faces-
config.xml). Although you can have multiple copies of faces-config.xml in a project, the
application loads these files as one at runtime.
All nodes within a JSF page flow must be JSF pages. No other types of objects can exist
within the JSF page flow.
Navigation is only between pages.
Application fragments cannot be reused.
There is no shared memory scope between multiple requests except for session scope.
ADF Task Flow:
The application can be broken up into a series of modular flows that call one another.

29/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

You can add to the task flow diagram nodes such as views, method calls, and calls to other
task flows.
Navigation is between pages as well as other activities, including routers.
ADF task flows are reusable within the same or an entirely different application. After you
break up your application into task flows, you may decide to reuse task flows containing
common functionality.
Shared memory scope (for example, page flow scope) enables data to be passed between
activities within the task flow. Page flow scope defines a unique storage area for each
instance of an ADF bounded task flow.
Task flows provide a more modular and transaction-aware approach to navigation and
application

101. How to convert an ADF bounded task flow to Unbounded Task Flow or
Page Fragments?
In the editor, open the bounded task flow diagram.
Right-click anywhere in the diagram other than on an activity or control flow.
Choose a menu item such as Convert to Unbounded Task Flow or Convert to Task Flow with
Page Fragments.
If the bounded task flow contains fragments, the menu item will be Convert to Task Flow
with Pages.

102. What is the method activity in the ADF Task flow?


Using this activity, you can invoke any method defined in manage-bean.

103. Can we use a task flow with the JSF page as a region?
No

104. How can we use the task flow with a JSF page as a region?
By using the context menu command “Convert To Task Flow With Page Fragments...”

105. Can you convert unbounded task flow to bounded task flow?
No, but we can extract part of it as TF by using the context menu “Extract Task Flow…”

106. How can we convert bounded task flow to unbounded task flow?
By using the context menu “Convert To Unbounded Task Flow”

107. Differentiate between static and dynamic regions?

30/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

14 Interactively Controlling with Navigation Components


108. How can navigation define in task flow?
Navigation can be defined in task flow using control flows and invoked by jsff/jspx page using
action event like button link etc.

109. Define the Train component?


The train component indicates the location of the current page within a multi-step process.
Each step is represented as a train stop
A train is a specialized type of task flow with linear steps

31/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

15 Ensuring Reusability in Web Applications


110. Types of reusable components?
Page templates
Task flow templates
Task flows
 Regions and
 Task flow call activities
Page fragments
Declarative components
Data controls
Business components
Application modules

111. How to develop reusable task flow in ADF?


Please follow the step below:
Define task flow
Define the deployment profile as ADF Library jar
Deploy ADF jar file
Open a new project where you want to consume the task flow.
Add the newly created jar of task flow project
Go to the component palate you will find your jar name to select it.
It will show the list of tasks flow you developed.
Drag and drop your task flow as a region on jsff/jspx page and run your application.

112. What are the ADF templates, jspx pages, jsff page & declarative
components?
ADF Faces provides the following types of reusable building blocks:
Page fragments (.jsff): Page fragments allow you to create parts of a page. A JSF page
can be made up of one or more page fragments. For example, a large JSF page can be
broken up into several smaller page fragments for easier maintenance. We can create a page
fragments template & use to create page fragments.
Page templates (.jspx): By creating page templates, you can create entire page layouts
using individual components and page fragments. For example, if you are repeatedly laying
out some components in a specific way in multiple JSF pages, consider creating a page
template for those pages. When you use the page template to build your pages, you can be
sure that the pages are always consistent in structure and layout across the application.
Using default layouts or creating new we can create page templates. Example: Using
<f:facet> we can create page templates with header, footer, top, left & right regions etc.
Declarative components: The declarative components feature allows you to assemble
existing, individual UI components into one composite, reusable component, which you then
declaratively use in one or more pages.
 For example, if you are always inserting a group of components in multiple places,
consider creating a composite declarative component that comprises the individual
components, and then reusing that declarative component in multiple places
throughout the application.
 Declarative components can also be used in page templates.
 Declarative components can also be used in other applications, it’s possible after
creating JAR file of that component.
32/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

113. What is a region in Oracle ADF?


Tag name: <af:region>
The region tag allows dynamic content to be included in a master page. This tag is bound
to a RegionModel. The model decides which viewId is to be included. The model has
methods that allow pre and post-processing of an include. See the javadoc for
oracle.adf.view.rich.model.RegionModel.
This component does not support any facets.
Regions support nesting (one af:region component can contain another af:region
component).
Regions are not allowed to be placed inside of af:forEach, c:forEach, or other
forEach-like tags because of limitations in how JSF handles component IDs and component
state which would manifest in your application in obscure manners such as loss of component
state. Regions are also not allowed to be placed inside of af:iterator because the region
requires bindings to be established at the tag execution phase in order to perform its JSP
include operations and the variables for iterators are not established until later in the life-
cycle.
Regions are reusable page flows. They have their own navigation rules, managed beans,
and ADFm page definitions. Each page within the region is a page fragment (jsff).
The <af:region> will not stretch all included children, but it will stretch an included child
if all of the following are true:
The region itself does not have a header
The region itself is being stretched
There is only a single included child
The child must be capable of being stretched
 Example: <af:region value="#{mybean.myRegionModel}"/>

114. What is a Resource Catalog?


Resource catalog is used to store some reusable components like pages, task flow, images, etc.
which can be added at run time.

33/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

16 Working with Scopes, Parameters and Partial Page Refresh


115. What are the various access scopes supported by ADF?
JSFscopes:
 None
 Application: The object is available for the duration of the application
 Session: The object is available for the duration of the session
 Request: The object is available from the time an HTTP request is made until a
response is sent back to the client
Additional ADF Faces scopes:
 Page Flow: The object is available for the duration of a task flow
 View: The object is available until the view ID for the current view activity changes.
This scope can be used to hold values for a given page
 Backing Bean: Used for managed beans for page fragments and declarative
components only, the object is available from the time an HTTP request is made until
a response is sent back to the client

116. Why use scopes?


Save the state of the model
Enable passing values to other pages or phases in the same scope
Can be accessed via EL or Java (except Backing Bean)

117. What are the different scopes of the ADF task flow?
Isolate/Shared. The shared scope will share data among the multiple instances of task flows while
Isolated doesn't.

118. How to access memory scopes attributes using EL?


#{applicationScope.applicationScopeVar}
#{sessionScope.sessionScopeVar}
#{requestScope.requestScopeVar}
#{pageFlowScope.pageFlowScopeVar}
#{viewScope.viewScopeVar}
#{backingBeanScope.bacingBeanScopeVar}

119. How to access memory scopes attributes using Java?


import oracle.adf.share.ADFContext;
ADFContext.getCurrent()
 .getApplicationScope().get("applicationScopeVar");
 .getSessionScope().get("sessionScopeVar");
 .getRequestScope().get("requestScopeVar");
 .getPageFlowScope().get("pageFlowScopeVar");
 .getViewScope().get("viewScopeVar");

120. What is the view scope?


View-state allocates a new viewScope when it enters. This scope may be referenced within the
view-state to assign variables that should live for the duration of the state. This scope is useful
for manipulating objects over a series of requests from the same view.

121. How to use the same value in multiple activities of a Task Flow?
34/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

Using Shared memory scope (for example, page flow scope) enables data to be passed between
activities within the task flow. Page flow scope defines a unique storage area for each instance of
an ADF bounded task flow.
Any managed beans you decide to use within task-flow can be specified in page flow scope, so
are isolated from the rest of the application

122. How to Use the pageFlowScope within Java Code?


You can access pageFlowScope from within any Java code in your application.
ADFContext.getCurrent().getPageFlowScope().put("windowTitle", "DepartmentName");
ADFContext.getCurrent().getPageFlowScope().get("windowTitle");
Remember to clear the scope once you are finished.

123. What are the different types of parameters?


Task flow call activity parameters
Task flow parameters
Region parameters
View activity parameters
Page parameters

124. How to pass values between pages?


The ADF Faces pageFlowScope makes it easier to pass values from one page to another, thus
enabling you to develop master-detail pages more easily. Values added to the pageFlowScope
automatically continue to be available as the user navigates from one page to another, even if
you use a redirect directive. But unlike session scope, these values are visible only in the current
page flow or process. If the user opens a new window and starts navigating, that series of windows
will have its own process. Values stored in each window remain independent.
Like objects stored in any standard JSF scope, objects stored in the pageFlowScope can be
accessed through EL expressions. The only difference with the pageFlowScope is that the object
names must use the pageFlowScope prefix. For example, to have a button's label provided by
a managed bean stored in the pageFlowScope, and to have a method on the bean called when
the button is selected, you might use the following code on your page:
<af:commandButton text="#{pageFlowScope.buttonBean.label}"
action="#{pageFlowScope.buttonBean.action}"/>
The pageFlowScope is a java.util.Map object that may be accessed from Java code. The
setPropertyListener tag allows you to set property values onto a scope, and also allows you
to define the event the tag should listen for. For example, when you use the
setPropertyListener tag with the type attribute set to action, it provides a declarative way
to cause an action source (for example, commandButton) to set a value before navigation. You
can use the pageFlowScope with the setPropertyListener tag to pass values from one
page to another, without writing any Java code in a backing bean. For example, you might have
one page that uses the setPropertyListener tag and a command component to set a value
in the pageFlowScope scope, and another page whose text components use the
pageFlowScope to retrieve their values.
You can also use the pageFlowScope to set values between secondary windows such as dialogs.
When you launch secondary windows from, for example, a commandButtonComponent, you
can use a launchEvent event and the pageFlowScope to pass values into and out of the
secondary windows without overriding values in the parent process.
35/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

125. Write an example of PPR?

126. What is PPR and how do you enable Partial Page Rendering (PPR)?
PPR is a feature supported by ADF Faces, using which we can render a small portion of an HTML
Page, without refreshing the complete page. It is enabled by.
Setting autoSubmit property to true on the triggering element.
Setting the partialTriggers property of the target component to refer to the component
id of the triggering element.

127. What are the PPR attributes?


partialSubmit – Used by commandItems
autoSubmit – Used by input items/lists etc.
partialTriggers – All components

36/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

17 Responding to Managed Beans, Events and Listeners


128. What is Managed Bean?
A managed bean is a java class, which is initialized by the JSF framework. It is primarily used to
hold view and controller logic. It is also used to execute java code to be executed on a user action
like Button Click.

129. What is Backing Bean?


Backing beans are those managed beans that have 1:1 mapping with a page. They have getters
and setters. for all the components in the related page.

130. What is the difference between managed and backing beans?


Backing bean has 1:1 relation with page whereas managed beans can be used in multiple pages.

131. If you want to show information to end-users in a secondary browser,


how will you show?
Use dialogs option from activities.
Examples:
You want to display help information to end-users to assist them with a task in the primary
browser window
You want to end-users to select a value from a list of values.

132. What are the different types of events?


Action events
 Occur when a command component is activated, such as when a user clicks a button
or a link
 Return a control flow outcome
Value change events
 Occur when the local value of an input component changes, such as when a user
selects a checkbox
 Are used for managing UI elements
Phase events
 Execute as part of the JSF and ADF life cycle
 Can be used to augment standard behavior

133. What are the types of event listeners?


ActionListener
 Fired by submit buttons, image maps, and hypertext links with attached JavaScript
 <h:commandButton value="..." .../>
 <h:commandButton image="..." .../>
 <h:commandLink .../>
 Automatically submit the form
ValueChangeListener
 Fired by combo boxes, checkboxes, radio buttons, textfields, and others
 <h:selectOneMenu .../>
 <h:selectBooleanCheckbox.../>
 <h:selectOneRadio .../>
 <h:inputText .../>
 Do not automatically submit the form
37/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

134. Explain the execution order of event and listeners?


Validator (managed bean method that performs validation on the component’s value)
Value change listener (managed bean method to handle value-change events)
Action listener (managed bean method to handle action events)
Action method (managed bean method to return a logical outcome String that is used in
navigation)

135. What is the Action Listener?


An action listener is a class that wants to be notified when a command component fires an action
event. An action listener contains an action listener method that processes the action event object
passed to it by the command component.

136. What is the difference between an action and an action listener?


Actions are designed for business logic and participate in navigation handling, whereas
action listeners typically perform user interface logic and do not participate in navigation
handling.
Action listener is a class that wants to be notified when a command component fires an
action event. Action returns String actionListener returns void. The action used for
page navigation with faces-config.xml or adf-config.xml, actionListener is
used for event handling, to retrieve data & other operations, it's used with backing beans or
bindings. Action use - for page navigation, actionListener use - checkbox, drop-down
box.

137. What is setActionListener?


The setActionListener tag is a declarative way to allow an action source to set a value before
navigation. It is perhaps most useful in conjunction with the “processScope” EL scope provided
by ADF Faces, as it makes possible to pass details from one page to another without writing any
Java code. This tag can be used both with ADF Faces commands and JSF standard tags.
Example: Suppose we have a table “employee”. We want to fetch the salary of an employee of
some particular row and want to send this salary on the Next page in process scope or request
scope etc. So, using this we can do this.
It has two attributes:
From – the source of the value; can be an EL expression or a constant value
To – the target for the value; must be an EL expression
<af:setActionListener from="#{row.salary}" to ="#{processScope.salary1}"/>
This setActionListener will pick the value of the salary of that row and store this value into
the salary1 variable. So, anyone can use this salary as processScope.salary1.
It is very simple to use and very useful.

138. What are Contextual events


The contextual event, in simple terms, is a way to communicate between task flows. Sometimes
we have task flow open in a region and have to get some values from that task flow. This scenario
can be achieved by contextual event.
Contextual Event has two parts:
Publisher Event (Producer)- As button or any component that can raise an event
Handler Event (Customer)- that listens and process event published by the producer

38/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

139. Describe the lifecycle of the ADF Page?


ADF page is an extension of JSF and has the following phases in its lifecycle:
Initialize Context: In this phase, the ADF page initializes the Lifecycle Context with
information that will be used during the Lifecycle.
Prepare Model: In this phase, the UI model is prepared and initialized. In this phase, page
parameters are set and methods in the executable section of the page definition of the ADF
page are executed.
Apply Input Values: This phase handles the request parameters. The values from the
HTML are sent to the server and applied to page binding in page definitions.
Validate Input Values: This phase validates the values that were built in the Apply input
values phase
Update Model: Validated values supplied from the user are sent to ADF business
components data model
Validate Model Updates: In this phase, the business components will validate user-
supplied values.
Invoke Application: This phase will process the UI events stack built during the life cycle
of the page and also fire navigational events
Prepare Render: This is the final phase where HTML code is generated from the view
tree.
Figure 1: JSF Life Cycle Phases

39/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

Figure 2: ADF Life Cycle Phases

140. What is the difference between setting an immediate=true on a button


and immediate=true on a text field?
When immediate is true on a button, the command’s action and actionListeners, including
the default actionListener provided by the Java Server Faces implementation, will be
executed during the Apply Request Values phase of the request processing lifecycle, rather than
waiting until the Invoke Application phase.
In the case of a text field, by default, values are converted and validated together in the Process
Validators phase. However, if you need access to the value of a component during Apply Request
Values – for example, if you need to get the value from an actionListener on an immediate
commandButton – then setting this to “immediate” makes that possible.

141. How to skip validation in ADF?


Add immediate="true" to the button. This way all input fields which don't have
immediate="true" will be skipped in processing. This method mainly used for view layer
validation to skip.
A view layer Keep immediate=true, at model layer using SkipValidation=<property>

40/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

142. What are validators and converters?


Validators and Converters are used to provide conversion and validation capabilities to the ADF
input components respectively. Converters convert the values on ADF forms to the type in which
the application accepts them after the values are edited on the form and submitted. Validators
reused to impose validations on the input components.

143. Where is the PhaseListener registered?


PhaseListener is registered in faces-config.xml

41/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

18 Binding Model Layer with Business Services and Databound View


144. How do you define pagination in ADF?
We define custom pagination in ADF by creating a custom table as a task flow using the
af:iterator tag. This renders the collection of data just as a table renders it. Now we
bind the value property of iterator to collection model from ADF bindings declaration and set
the number of visible rows to, say 15.
Using JavaScript
Customizing VO java code.

145. How to pass ''af:selectOneChoice'' value to other page?


Add valuePassThru="true" attribute to select list.

146. How to make any field mandatory?


Add attribute required="true" to that specific field.

19 Querying Data with Search Components


147. Differentiate between Query and Quick Query components?
Query:
 The query component provides the user the ability to perform a query or personalize
saved searches
 Advanced mode query with dynamically added search criterion
Quick query:
 Has a selectable list of attributes to search on
 Has a single search criterion input field
 Can have a link to more advanced search capabilities, with switching implemented in
a managed bean

20 Implementing Transactions
148. How can you manage the transaction in ADF?
We can manage transactions using Application Module, different Application Modules, Bounded
Task Flows & at ADF Data Control Level.

149. How can you force ADF task flow to use new transactions every time task
flow is called?
Go task flow overview and select always begin new transaction from the dropdown.

150. How to use the same transaction in the ADF task flow?
Go task flow overview and select ‘always use existing transaction’ from the dropdown.

151. What are the different data control scope?


Isolated
Shared (Default)-Data is shared with the parent flow

42/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

21 Understanding Data Controls and Bindings


152. Explain the ADF Binding/Model layer?

153. Explain Data binding and its types and sub-types?


Oracle Application Development Framework (Oracle ADF) provides several types of binding objects
to support the attributes and operations exposed by the Oracle ADF data controls for a particular
business object:
Iterator binding: One per accessor attribute that your page or panel displays. Iterates
over the business objects of the data collection and maintain the row currency and state.
Value bindings: One for each data-bound UI component provides access to data. Value
Binding Types:
 Attribute Value Binding: This is binding to retrieve the value of a single view attribute
in the iterator binding’s current view row. For e.g.:
#{bindings.CustomerId.InputValue}
 Boolean Value Binding
 List Value Binding
 Table Binding: This is used for tables, tree-tables, and trees. It is used to expose rows
of a table in the iterator binding’s current range. Eg.: All Customers-
#{bindings.AllCustomers.labels.CustomerId}
 Range Value Binding
Action binding: This binding type is used when buttons or command links are dropped on
the user interface and require an action to be performed on them. We can use data control
operations on them. Eg.: Create, Delete, First, Last, Commit, Rollback, etc. Action Binding
Types:
 Method Bindings: This binding is used when you want to use custom methods to be
executed.

43/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

154. Explain ADF Configuration Metadata files?

44/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

155. How to invoke Expression Language programmatically?

156. Explain the ADF binding class hierarchy?

45/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

157. Explain the programmatic approach to get a binding container?

158. What are binding context and binding container?


Binding context is a runtime map between the data controls and page definition of pages in the
application which is used to access the binding layer. It is accessible through the EL expression in
your jspx pages. A binding container is a request-scoped map that is used to instantiate the page
bindings. This is accessible through the EL expressions. Also, since it is a request-scoped map, it
is accessible during every page request.

159. When we drag-drop VO from DataControl which binding occurs?


Value binding occurs.

160. What is the difference between databindings.cpx and


datacontrol.dcx?
dataBindings.cpx: It contains the Oracle ADF binding context for your entire application
and provides the metadata from which the Oracle ADF binding objects are created at
runtime. JDeveloper creates this file the first time you bind data to a UI component.
dataControls.dcx: It contains information needed to initialize the data control to work
with a particular service (JavaBean, EJB, XML, Webservice and so on). JDeveloper creates
this file the first time you create data control i.e when you register data controls on the
business services. This file is not generated for Oracle ADF Business Components. It
identifies the Oracle ADF model layer data control classes (factory classes) that facilitate the
interaction between the client and the available business service.

161. In the case of java control or EJB does it have a datacontrol.dcx file?
datacontrols.dcx exists when you create custom data controls based on POJOs, web services,
EJBs and the like. It describes or stores the metadata about the data control, essentially the wiring
required to make the underlying service (e.g. POJOs, web services) exposed through the data
control palette, and runtime settings so the ViewController layer knows how to make use of it.
46/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

162. Write code to access the current row and or the view object inside your
bean?
Code to access the current row and or the view object inside your bean:
BindingContainer bc =
BindingContext.getCurrent().getCurrentBindingsEntry();
DCBindingContainer dcbc = (DCBindingContainer) bc;
DCIteratorBinding lBinding =
dcbc.findIteratorBinding("EmployeesViewIterator");
EmployeesViewRow row = (EmployeesViewRow) lBinding.getCurrentRow();
EmployeesView view = (EmployeesView) lBinding.getViewObject();

163. Explain Iterator rangeSize Attribute


Iterator bindings have a rangeSize attribute that the binding uses to determine the number of
data objects to make available for the page for each iteration. This attribute helps in situations
when the number of objects in the data source is quite large. Instead of returning all objects, the
iterator binding returns only a set number, which then becomes accessible to the other bindings.
Once the iterator reaches the end of the range, it accesses the next set.
The example shows the default range size for the CustomerInfoVO iterator.
Example rangeSize Attribute for an Iterator
<iterator Binds="CustomerInfoVO" RangeSize="25"
DataControl="StoreServiceAMDataControl"
id="CustomerInfoVO1Iterator" ChangeEventPolicy="ppr"/>
By default, the rangeSize attribute is set to 25.
You can set it to -1 to have the full recordset returned.

164. What is the purpose of adfc-config.xml?


The adfc-config.xml file is the configuration file for an ADF unbounded task flow. This file
contains metadata about the activities and control flows contained in the unbounded task flow.

165. What is the purpose of faces-config.xml?


Use the faces-config.xml file to register a Framework application’s resources, such as custom
validators, managed beans, and page-to-page navigation rules.

166. What is the difference between trinidad.config and trinidad.skins?


trinidad.config file is created when you create an ADF application. This is used to register
the skin-family you are going to use for your entire application. trinidad.skins is used when
we use the skin as a Jar file. This file provides a mapping between the Skin Id and the actual path
where the skin exists.

47/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

22 Programmatically Customizing Business Services


167. Explain the different types of EO’s Java classes that can be generated?
<EntityEO>Impl.java:
 Is the entity class
 Represents a row
 Provides getter and setter methods
<EntityEO>CollImpl.java:
 Represents the cached set of rows from the entity
 Is not necessary for the user to modify or override methods in this class
<EntityEO>DefImpl.java:
 Is the entity definition class
 Represents the whole entity
 Can be used to modify the entity definition

168. Explain the different types of VO’s Java classes that can be generated?
<ViewobjectVO>Impl.java:
 Is the view class
 Provides methods to manage the row set
<ViewobjectVO>RowImpl.java:
 Is the view object row class
 Is instantiated for each record returned by the query
 Provides attribute accessors
<ViewobjectVO>DefImpl.java:
 Is the view definition class
 Represents the whole view
 Can be used to modify the view definition

169. Explain the different types of AM’s Java classes that can be generated?
<AppMod>Impl.java:
 Contains all the methods and behaviors that affect each AM instance
<AppMod>Def.java:
 Contains methods to be used by all instances of the application module

170. What is the return type of Service Methods?


Service Methods can return Scalar or Primitive Data types.

171. Can Service Methods return type Void?


Yes, Service Methods can return type Void

172. Can Service Methods return Complex Data types?


No, service methods can return only primitive/scalar data types.

173. What are the interfaces that define database transactions?


Transaction & DBTransaction are interfaces that define database transactions.

48/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

23 Deploying ADF Applications


174. How do you decide whether the application should be deployed as an EAR
or a WAR?
If the application contains run-time customizations using MDS, it must be bundled as an EAR. For
simple ADF application with no such customizations, WAR can be created.

175. What are the various tools used for deployment?


JDeveloper’s default build tools
Ant
Maven

24 Securing ADF Applications


176. What is the difference between Authentication and Authorization?
Authentication: determines which users can access the application.
Authorization: determines what functions users are allowed to perform after they enter the
application.

177. What is the purpose of jazn-data.xml?


This file is used for defining the permissions and privileges for various groups of users on various
task flows created in the application.

178. What is the policy store and identity store in OID?


Identity Store is used to store information about users and groups while the Policy Store is used
to store information about security policies.

49/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

25 Debugging and Troubleshooting ADF Applications


179. How do you display a debug message to the console?
By setting Java options: -Djbo.debugoutput=console

180. How would you test business service in isolation from views or
controllers?
Using ADF Model Tester and
Using Java test clients

181. Name some tools and utilities used for debugging?


JUnit
JDeveloper Profiler
Audit Profiles
FileMon
JDeveloper Debugger

50/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

26 Best Practices
182. Give some best practices in ADF?
1. Do not use invokeAction in pageDef because it will be executed several times. Use
instead of a task flow with a method call in front. Also, using this approach, we can reuse
the page in other task flows.
2. Do not create view criteria containing the name of the view since the name of the view could
be changed and then also, the criteria name should be changed.
3. Use unbounded tasks only for pages or bounded task flows available as bookmarks.
4. Do not use unbounded task flows for the following operations: create, update and delete. It
should be used only for read operations.
5. Do not add service methods in the application model that are dependent on the view iterators
(default iterators). Use instead of standard operations like CreateWithParams,
ExecuteWithParams, etc.
6. Create secondary iterators for views in the service methods. Do not use default iterators
because they are the same used in the view layer.
7. Do not add HTML in JSF. Use instead styles and/or CSS for available ADF components.
8. Try to not use the view’s attributes in the WHERE clause for filtering. Use instead default
criteria for each view instance from the application model.
9. Do not use two services layers separately with different database connections to the same
database if is not needed. Use instead of nested application models.
10. Always use the scope prefix for any accessed memory variables (requestScope,
backingBeanScope, viewScope, pageFlowScope, sessionScope,
applicationScope, backingBeanScope).
11. Put the Cancel operation in af:subform and with immediate=true, to ignore the
validations of other input fields which have immediate=true.
12. In the context of fragment-based task flows, use viewScope in preference to request scope
for a more predictable behavior within the context of the sub-flow that contains the
fragments
13. Task flows should always contain an activity marked as an exception handler. This activity
does not have to be a view activity it can be a method or router (our preferred approach)
with control flow rules to subsequent activities.
14. Use SetPropertyListener instead of SetActionListener (was deprecated in 11g).
15. Do not combine view accessors with data model master-detail because accessor attributes
create distinct row sets based on an internal view object other than that from detail.
16. When a view criteria is applied programmatically in a business method from the application
model later the view criteria must be removed.
17. Try to use the data model master-detail only for composite relations.
18. For a performance increase, you can tune the view instance from the application model to
get from DB more than one row once. By default, it is 1.

51/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

27 Miscellaneous Topics
183. What are some of the ADF 12c features?
Business Components:
Support for offline databases: The user can create new offline database objects based on
existing objects in a database. The user can also compare the two. New wizards make
working easier.
Support for RowFinder feature: The Row Finder feature provides users a declarative means
of using a View Criteria on a View Object. A use case is to use a Row Finder object to find a
row (or a set of rows) in a single subordinate detail table based on a row in a master table.
Support for multiple required View Criteria: Multiple View Criteria can be created on a single
View Object. Besides, one or more of them can be marked as required so that one can now
have multiple mandatory View Criteria being used per View Object.
Groovy Debugging: One can set breakpoints and use the debugger to debug Groovy
expressions.
REST Web Service Improvements:
 Include children in describe: Clients can request information about the collection and
nested resources using the new "includeChildren" query parameter. When a
resource item is requested and includeChildren=true is provided, all children will
be recursively included in the describe.
 Expand multiple levels of children: The expand query parameter is enhanced to support
multiple levels, for example:
"app/rest/Accounts/12345?expand=Contacts,Contacts.Addresses"
returns all contacts for the account and all addresses for the contacts.
 Versioning of REST payload formats is now supported, enabling clients to continue
working with older formats when backward incompatible changes are introduced.
 Improved query capabilities: For richer querying support, the query parameter accepts
a new SQL-like VC filter expression format that identifies the specific rows to retrieve
from the resource. Example: (AssignedTo_Id is null) or ((Priority <=
2) and (RecordName like 'TT-99%'))
ADF Model:
Bean Data Control Improvements:
 Create Bean Data Control Wizard with new options for scrolling and range paging as
well as defining a wrapper class for data control implementation code
 Declarative Lists of Values (LOV)
 Automatically call mergeEntity
 Support CreateInsert and CreateWithParameters operations
Web Service Data Control Enhancements:
 Support for all REST operations
 Create a Web Service Data control from RESTful service URL
ADF Controller:
Pretty URLs: In this release, the ADF Controller state information is no longer included in the
URL whenever possible.
Unauthorized Region Taskflow: Allows the developer to specify a "fallback" bounded task
flow to be shown in case the user is not authorized to access the current one.
Recursive bounded task flows Support for calling bounded task flows recursively. In previous
versions, the view layer did not detect that the view activity had occurred and did not re-
render the region.

52/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

ADF View (ADF Faces, DVT):


JSF 2.0 Support:
 Facelets
 Ajax
 Get
 Composite components
 Annotated managed beans
 New scopes
 Conditional navigation
 Add EL directly in the page content
 EL methods with arguments
 System events
Skyros and Alta Skin
Code Editor
Enable Runtime Skin Updates
Calendar support for 15min appointments and the ability to zoom in
OutputFormatted supports header tags h1 to h6
Reorder Fields in Query
ADF No Longer Requires Special Accessibility Modes
af:inputDate now opens immediately on the client
Export to Excel / CSV Enhancements

53/54
ADF Essentials Training by Deepak Bhagat
Oracle Application Development Framework (ADF) Questions and Answers

28 Advance Topics
184. What is the contextual event, explain with a diagram?
The contextual event, in simple terms, is a way to communicate between task flows. Sometimes
we have task flow open in a region and have to get some values from that task flow. This scenario
can be achieved by the contextual event.
Contextual Event has two parts:
Publisher Event (Producer)- As button or any component that can raise an event
Handler Event (Customer)- that listens and process event published by the producer

54/54
ADF Essentials Training by Deepak Bhagat