Você está na página 1de 11

ADF Interview Questions

What is Oracle ADF?

A: Oracle ADF is a commercial java/j2ee framework, which is used to build enterprise applications. t is one of the most comprehensive and advanced framework in market for !2""

Describe Oracle ADF Architecture? A: n line with communit# best practices, applications #ou build usin$ the Fusion web technolo$# stack achieve a clean separation of business lo$ic, pa$e navi$ation, and user interface b# adherin$ to a model%view%controller architecture. As shown in &'( architecture: )he model la#er represents the data values related to the current pa$e the view la#er contains the * pa$es used to view or modif# that data the controller la#er processes user input and determines pa$e navi$ation. )he business service la#er handles data access and encapsulates business lo$ic

Oracle ADF +usiness (omponents, which simplifies buildin$ business services. Oracle ADF Faces rich client, which offers a rich librar# of A!A,%enabled * components for web applications built with !ava -erver Faces .!-F/.

Oracle ADF (ontroller, which inte$rates !-F with Oracle ADF &odel. )he ADF (ontroller e0tends the standard !-F controller b# providin$ additional functionalit#, such as reusable task flows that pass control not onl# between !-F pa$es, but also between other activities, for instance method calls or other task flows. -imple Oracle ADF Architecture

What are the advantages of using ADF? A: Followin$ are the advanta$es of usin$:

t supports 1apid Application Development. t is based on &'( architecture Declarative Approach .,&2 Driven/ -ecure 1educes maintenance cost and time -OA "nabled

What are various components in ADF? A: Oracle ADF has followin$ components

ADF +usiness (omponents.&odel/ ADF Faces .'iew/ ADF )ask flows.(ontroller/

Describe life cycle of an ADF Page? A: ADF pa$e is an e0tension of !-F and has followin$ phases in its lifec#cle 3. Initialize Context: n this phase the adf pa$e initiali4es the 2ifec#cle(onte0t with information that will be used durin$ the 2ifec#cle.

2. Prepare Model: n this phase ui model is prepared and initiali4ed. n this phase pa$e parameters are set and methods in the e0ecutable section of the pa$e definition of the ADF pa$e are e0ecuted. 5. Apply Input Values: )his phase handles the re6uest parameters. )he values from the 7)&2 are sent to the server and applied to the pa$e bindin$ in pa$e definitions. 8. Validate Input Values: )his phase validates the values that were built in the Appl# input values phase 9. Update Model: 'alidated values supplied from user are sent to ADF business components data model :. Validate Model Updates: n this phase the business components will validate user supplied values. ;. Invoke Application: )his phase will process the ui events stack built durin$ the life c#cle of pa$e and also fire navi$ational events <. Prepare Render: )his is the final phase where 7)&2 code is $enerated from the view tree. !plain the architecture of ADF "# Oracle ADF "usiness #omponents is a framework implements the +usiness -ervices la#er on top of a data source in a declarative wa#. t provides out%of%the%bo0 services such as transaction mana$ement, resource poolin$, lockin$, declarative validation rules, translation, and object%relational mappin$. )o use Oracle ADF +(, #ou use wi4ards in !Developer to create:

Application Module o An application module is a service component that * or =eb -ervice clients use to work with application data. t defines an updatable data model and top%level procedures and functions .called service methods/ for a lo$ical unit of work related to an end%user task. )o simplif# the task of implementin$ #our services, #ou levera$e a set of business components like entity ob$ects and view ob$ects. o >ou can enable a service interface on an# Application %odule. )he service interface e0pose Application %odules as remotable services allowin$ third%part# applications to find, create, update and delete business information usin$ standard web services protocols. All of the business validation rules encapsulated in #our ntity Ob$ects are automaticall# enforced throu$h this service interface as well.

>ou can use an# application module both as a local component and as remotel#% accessible service. )his allows #ou to support both interactive =eb user interfaces as well as pro$rammatic =eb%service clients with the same component.

Entity object o An entity ob$ect represents a row in a database table and simplifies modif#in$ its data b# handlin$ all D&2 operations for #ou. t can encapsulate business lo$ic for the row to ensure #our business rules are

consistentl# enforced. >ou associate an entit# object with others to reflect relationships in the underl#in$ tables to create a la#er of business domain objects to reuse in multiple applications. Vie object

A view ob$ect represents a -?2 6uer# and simplifies workin$ with its results. >ou declarativel# join, project, filter, sort, and a$$re$ate entit# object data into e0actl# the @shape@ re6uired b# the end%user task at hand, includin$ the abilit# to link a view object with others to create master/detail hierarchies of an# comple0it#. =hen users modif# business data usin$ a view object, that component automaticall# collaborates with entit# objects to consistentl# validate and save the chan$es. )he followin$ dia$ram illustrates the relationship amon$ application module, entit# object, and view object. A view object defines a 6uer# and produces a row set of rows. 'iew objects and entit# objects collaborate to enable an updatable data model. Application module contains view objects and it provides transaction.

Where is that we write business rules&validations in ADF and why? A : =e should be writin$ validations at "ntit# Object level, because the# provide hi$hest de$ree of reuse. What is %anaged "ean? A : &ana$ed bean is a java class, which is initiali4ed b# !-F framework. t is primaril#

used to hold view and controller lo$ic. t is also used to e0ecute java code to be e0ecuted on a user action like +utton (lick. What is "ac'ing "ean? A : +ackin$ beans are those mana$ed beans which have 3:3 mappin$ with a pa$e. )he# have $etters and setters for all the components in the related pa$e. What is difference between managed and bac'ing beans? A : +ackin$ bean has 3:3 relation with pa$e whereas mana$ed beans can be used in multiple pa$es. +ackin$ beans scope is limited to the pa$e whereas mana$ed beans can have other scopes too. What is task flow? A: ADF tas' flows provide a modular approach for definin$ control flow in an application. nstead of representin$ an application as a sin$le lar$e !-F pa$e flow, #ou can break it up into a collection of reusable task flows. "ach task flow contains a portion of the applicationAs navi$ational $raph. )he nodes in the task flows are activities. An activity node represents a simple lo$ical operation such as displa#in$ a pa$e, e0ecutin$ application lo$ic, or callin$ another task flow. )he transactions between the activities are called control flow cases What are types of task flow? A: )he two t#pes of ADF task flow are: ! Unbounded task "lo : A set of activities, control flow rules, and mana$ed beans that interact to allow a user to complete a task. An ADF unbounded task flow consists of all activities and control flows in an application that are not included within an# bounded task flow.

! #ounded task "lo : A speciali4ed form of task flow that, in contrast to an unbounded task flow, has a sin$le entr# point and 4ero or more e0it points. t contains its own set of private control flow rules, activities, and mana$ed beans. An ADF bounded task flow allows reuse, parameters, transaction mana$ement, and reentr#. An ADF bounded tas' flow is used to encapsulate a reusable portion of an application. A bounded task flow is similar to a !ava method in that it: B 7as a sin$le entr# point B &a# accept input parameters B &a# $enerate return values B 7as its own collection of activities and control flow rules B 7as its own memor# scope and mana$ed bean lifespan .a pa$e flow scope instance/ A bounded task flow can call another bounded task flow, which can call another and so on. )here is no limit to the depth of the calls. )he checkout process is created as a separate ADF bounded task flow, as shown

What is the difference between "ounded and (n"ounded tas'flows? A : Differences between +ounded and *n+ounded taskflows :

+ounded taskflows can be secured but *nbounded canAt. +ounded taskflows can accept parameter and return values but unbounded taskflows donAt support parameters +ounded taskflows has a sin$le entr# point or a default activit# but unbounded taskflows have multiple entr# points. +ounded taskflows can be called from other bounded/unbounded taskflows but unbounded cannot be called or reused. +ounded taskflows support transactions unbounded donAt

Advantage of Task Flow Over JSF flow? A ADF task flows offer si$nificant advanta$es over standard !-F pa$e flows

)he application can be broken up into a series of modular flows that call one another. >ou can add to the task flow dia$ram nodes such as views, method calls, and calls to other task flows. Cavi$ation is between pa$es as well as other activities, includin$ routers. ADF task flows are reusable within the same or an entirel# different application.After #ou break up #our application into task flows, #ou ma# decide to reuse task

-hared memor# scope .for e0ample, pa$e flow scope/ enables data to be passed between activities within the task flow. Da$e flow scope defines a uni6ue stora$e area for each instance of an ADF bounded task flow.

What are the various access scopes supported by ADF? A : ADF Faces supports the followin$ scopes

Application -cope -ession -cope Da$eFlow -cope 1e6uest -cope +ackin$+ean -cope.

!"plain different access scope in ADF #anaged $eans%? A:

application: )he application scope lasts until the application stops. 'alues that #ou store in a mana$ed bean with this scope are available to ever# session and ever# re6uest that uses the application. session: )he session scope be$ins when a user first accesses a pa$e in the application and ends when the userAs session times out due to inactivit#, or when the application invalidates the session. pa$e%lo : this is accessible across the activities within a task flow. A mana$ed bean that has a pa$eFlow scope shares state with pa$es from the task flow that access it. A mana$ed bean that has a pa$eFlow scope e0ists for the life span of the task flow. f another task flowAs pa$e references the mana$ed bean, the mana$ed bean creates a separate instance of this object and adds it to the pa$eFlow scope of its task flow. backin$#ean: A backin$ bean is a convention to describe a mana$ed bean that stores accessors for * components and event handlin$ code on a !-F pa$e. t e0ists for the duration of a re6uest and should not be used to maintain state.*se this scope if it is possible that #our task flow appears in two ADF re$ions on the same !-F pa$e and #ou want to isolate each instance of ADF re$ion. vie :*se this scope for mana$ed bean objects that are needed onl# within the current view activit# and not across view activities. t defines scope for each view port that ADF (ontroller mana$es, for e0ample, a root browser window or an ADF re$ion.)he life span of this scope be$ins and ends when the current view d of a viewport chan$es. f #ou specif# view, the application retains mana$ed bean

objects used on a pa$e as lon$ as the user continues to interact with the pa$e. )hese objects are automaticall# released when the user leaves the pa$e.

re&uest *se re6uest scope when the mana$ed bean does not need to persist lon$er than the current re6uest.

What is PP) and how do you enable Partial Page )endering*PP)+? A : DD1 is a feature supported b# ADF Faces, usin$ which we can render a small portion of a 7)&2 Da$e, without refreshin$ the complete pa$e. t is enabled b#.

-ettin$ Auto'ub(it propert# to true on the tri$$erin$ element. -ettin$ the Partial)ri$$ers propert# of tar$et component to refer to component id of the tri$$erin$ element

What is region in Task Flow? Ans: >ou can render a bounded task flow in a !-F pa$e or pa$e fra$ment ..jsff/ b# usin$ an ADF re$ion. An ADF re$ion comprises the followin$. >ou create an ADF re$ion b# dra$$in$ and droppin$ a bounded task flow that contains at least one view activit# or one task flow call activit# to the pa$e where #ou want to render the ADF re$ion. )his makes sure that the ADF re$ion #ou create has content to displa# at runtime What are different Task Flow &o'ponent? A:

&ethod call%Drovide a wa# to e0ecute code within the flow. 1outer E Drovided wa# to branch the flow based on condition or b# el. -ave Doint 1estore: Allows developer to take a snapshot of and ,then resotre,application state at specific point in flow. )ask Flow (all%Allow task flow to be called from this task flow. *12 'iew%=a# to reach out the flow and potentiallu out o$ web application to some arbitrar# *12 such as http://www.techartifact.com 'iew:Allow displa# of pa$e and pa$e fra$ment. (ontrol Flow (ase: Define flow between two activies.-imilar to navi$ation case in ADF 3F$ or default jsf navi$ation en$ine. =ild(ard (ontrol Flow 1ule: Drovides wa# to define an ori$in for one or more $lobal control flow cases that are shared and available from multiple activities on the dia$ram.

What is the return type of ,ervice %ethods? A: -ervice &ethods can return -calar or Drimitive Data t#pes. #an ,ervice %ethods return type -oid? A: >es, -ervice &ethods can 1eturn t#pe 'oid #an ,ervice %ethods return #omple! Data types? A : Co, service methods can return onl# primitive/scalar data t#pes. Which component in ADF "# manages transaction ? A : Application &odule, mana$es transaction. #an an entity ob$ect be based on two Database Ob$ects*tables&views+ or two Webservices ? A : Co entit# objects will alwa#s have one to one relationship with a database object or web service.

What is Association and (iewlink ? Ans: )he# define the join or the link amon$ "OAs and 'OAs.Association defines link between "OAs.)he# can be considered as Drimar#Ge#/Forei$nGe# relationship between tables. )he 'iewlink is for a 'O. t defines the !oin conditions.A viewlink can be based on an association or based on attributes,+asin$ viewlinks on associations have the same advanta$e of entit# cache and few more which are unveiled later. What is the $usiness &o'ponent Tester A: )he mostl# used component of the model la#er is the tester, which is used to run and check the data model that is implemented.)his serves as the first line of defense to see if data is e0posed as we need it and to test the data model with out a need to create a * . What is Association Accessor? A: tAs an operation b# which an entit# instance at one end of and association can access the related entit# object instance at the other end of the association. An Accessor that travels from destination to source is called a source accessor and an accessor that travel from source to destination is called a destination accessor. t is described in the entit# object definition 0ml files which can be used b# view object and view link definition to specif# cross entit# relationship. ts return t#pe will be the

entit# object class of associated entit# object definition or H"ntit# mplA if the associated entit# object definition has no entit# object class. What are different data control scope? A: 3/ 2/ solated: -hared.Default/%Data is shared with the parent flow.

What is Data"indings.cp! file Data+indin$s.cp0 : )his file contains the pa$e map, pa$e definitions references, and data control references. )he file is created the first time #ou create a data bindin$ for a * component .either from the -tructure window or from the Data (ontrols Danel/. )he Data+indin$s.cp0 file defines the Oracle ADF bindin$ conte0t for the entire application. )he bindin$ conte0t provides access to the bindin$s and data controls across the entire application. )heData+indin$s.cp0 file also contains references to the Da$eDef.0ml files that define the metadata for the Oracle ADF bindin$s in each web pa$e. )ow to &usto'i*e the Application +ook and Feel with Skins?