Thursday 1 November 2018

Frequently Asked Oracle ADF Interview Question and Answer Part 1

Hi All, In this post I'll share some interview questions and answers which i have faced or asked in interview panel.

1). What is Oracle Adf?
Ans).The Oracle Application Development Framework (Oracle ADF) is an end-to-end
application framework that builds on J2EE standards and open-source technologies to
simplify and accelerate implementing service-oriented applications. If you develop
enterprise solutions that search, display, create, modify, and validate data using web,
wireless, desktop, or web services interfaces, Oracle ADF can simplify your job. 2). Adf Life cycle?

2). Describe Lifecycle of a Web Page Request Using Oracle ADF? 
Ans).A web request for http://yourserver/yourapp/faces/some.jsp arrives from the client to the application server
The ADFBindingFilter finds the ADF binding context in the HTTP session, and if not yet present, initializes it for the first time.
During binding context initialization, the ADFBindingFilter:
Consults the servlet context initialization parameter named CpxFileName and appends the *.cpx file extension to its value to determine the name of the binding context metadata file. By default the parameter value will be “DataBindings“, so it will look for a file named DataBindings.cpx.
Reads the binding context metadata file to discover the data control definitions, the page definition file names used to instantiate binding containers at runtime, and the page map that relates a JSP page to its page definition file.
Constructs an instance of each Data Control, and a reference to each BindingContainer. The contents of each binding container are loaded lazily the first time they are used by a page.
The ADFBindingFilter invokes the beginRequest() method on each data control participating in the request. This gives every data control a notification at the start of every request where they can perform any necessary setup.
An application module data control uses the beginRequest notification to acquire an instance of the application module from the application module pool.
The JSF Lifecycle class, which is responsible for orchestrating the standard processing phases of each request, notifies the ADFPhaseListener class during each phase of the lifecycle so that it can perform custom processing to coordinate the JSF lifecycle with the Oracle ADF Model data binding layer.
Note:TheFacesServlet (in javax.faces.webapp) is configured in the web.xml file of a JSF application and is responsible for initially creating the JSF Lifecycle class (in javax.faces.lifecycle) to handle each request. However, since it is the Lifecycle class that does all the interesting work, the FacesServlet is not shown in the diagram.
The ADFPhaseListener creates an ADF PageLifecycle object to handle each request and delegates appropriate before/after phase methods to corresponding methods in the ADF PageLifecycle class as shown in If the appropriate binding container for the page has never been  used before during the user’s session, it is created.
How JSF Page Lifecycle and ADF Page Lifecycle Phases Relate
The JSF Lifecycle forwards control to the page to be rendered.
The UI components on the page access value bindings and iterator bindings in the page’s binding container and render the formatted output to appear in the browser.
The ADFBindingFilter invokes the end Request() method on each data control participating in the request. This gives every data control a notification at the end of every request where they can perform any necessary resource cleanup.
An application module data control uses the endRequest notification to release the instance of the application module back to the application module pool.
The user sees the resulting page in the browser.

3). How to Create an Oracle ADF Page?
Ans).Right click on AdfDemoUi project  >  New >  New Gallery  > JSF Page .
Click Ok. Create  JSF/jspx Page dialog opens up .

4). How to Improve Performance in Jdeveloper?
Ans).Below might be possible solution.
  • configurejdeveloper to open jsp/jsff's in source view. 
  • Use the property editor if possible. Avoid typing in the source 
  • Disable the source control plugin - Use Tortoise SVN or other source control outside of jdeveloper. 
  • Recommend a minimum of 3G but 4G preferred 
  • set the ide.conf memory size to at least 768 
  • Restart jdeveloper if memory usage climbs above 1G
5). Explain ADF Architecture?
Ans).applications you build using the Fusion web technology stack achieve a clean separation of business logic, page navigation, and user interface by adhering to a model-view-controller architecture. As shown in in an MVC architecture:
The model layer represents the data values related to the current page The view layer contains the UI pages used to view or modify that data The controller layer processes user input and determines page navigation. The business service layer handles data access and encapsulates business logic
Oracle ADF Business Components, which simplifies building business services.
Oracle ADF Faces rich client, which offers a rich library of AJAX-enabled UI components for web applications built with JavaServer Faces (JSF).
Oracle ADF Controller, which integrates JSF with Oracle ADF Model. The ADF Controller extends the standard JSF controller by providing additional functionality, such as reusable task flows that pass control not only between JSF pages, but also between other activities, for instance method calls or other task flows.

6). Difference among autosubmit, partial Submit and Partial trigger?
Ans).Partial Submit - ADF Faces adds the concept of partial form submit to JavaServer Faces 1.2 and beyond. A partial submit actually is a form submit that does not require a page refresh and only updates components in the view that are referenced from the command component PartialTriggers property. Another option for refreshing a component in response to a partial submit is call AdfContext.getCurrentInstance.addPartialTarget(component_instance_handle_goes_here)in a managed bean. If a form contains required fields that the user left empty invoking the partial submit, then errors are shown for each of the field as the full form gets submitted. 
Autosubmit - An input component that has its autosubmit property set to true also performs a partial submit of the form. However, this time it doesn't submit the entire form but only the component that triggers the submit plus components referenced it in their PartialTriggers property.
use case 1: Running the view, entering data into inpA and then tabbing out of the field will submit the content for inpAbut not for inpB and inpC. Further more, none of the required field settings on inpB and inpC causes an error.
use case 2: You change the configuration of inpC and set its PartialTriggers property to point to the ID of componentinpA. When rerunning the sample, entering a value into inpA and tabbing out of the field will now submit the inpA and inpC fields and thus show an error for the missing required value on inpC.
Internally, using autosubmit=true on an input component sets the event root to just this field, which good to have in case of dependent field validation or behavior. The event root can extended to include other components by using the Partial Triggers property on these components to point to the input field that has autosubmit=true defined.
PartialSubmit vs. AutoSubmit
Partial submit set on a command component submits the whole form and leaves it to the developer to decide which UI component is refreshed in response. Client side required field validation (as well as the server side equivalent) is not disabled by executed in this scenario. Setting immediate=true on the command item to skip validation doesn't help as it would also skip the model update.
Auto submit is a functionality on the input components and also performs a partial form submit. However, in addition an event root is defined that narrows the scope for the submitted data and thus the components that are validated on the request.
7). what is Immediate is true?
Ans).·                     Processing  of any components with Immediate attribute is moved up to the Apply Request Values phase of the lifecycle. But there is a big difference in processing of editableValueHolder (inputText) and actionSource (commandButton) components.
·                     For EditableValueHolder components (like inputText) with Immediate attribute validation and valueChangeEvent delivering are done in Apply Request Values phase instead of usualProcess Validation phase. This is the only change. The lifecycle is not stopped, it is going on, there is no any lifecycle phase skipping!
 Restore View->Apply Request Values->Process Validations->Update Model->Invoke App->Render Response 
·                     For ActionSource components (like commandButton) with Immediate attribute, action event is delivered to Apply Request Values phase instead of usual  Invoke Application phase. But!!! After that the lifecycle is jumping to the end, to Render Response phase. Validation and Model Update phases are skipped.
  Restore View->Apply Request Values->Render Response 
In ADF application we have either
1. input component
2. Command component
You can use the immediate attribute to allow components on the page to be validated in the Apply Request Values phase of the life cycle as opposed to the Process Validations phase:
•Input component- Using immediate on an means that that component’s value is validated before any input components that do not have the immediate attribute set to true. Therefore, if a validation error occurs on an immediate input component, the life cycle moves from the Apply Request Values phase (where the immediate attribute is evaluated) to the render phase, and validation does not run on any “nonimmediate” input components. Additionally, if the new value of an immediate input component is different from the existing value, then a ValueChangeEvent is raised. However, instead of the event being processed during the Process Validations phase, the event is processed at the end of the Apply Request Values phase. Therefore, any ValueChangeListener associated with the immediate input component executes before any command component’s ActionListener (assuming the command component occurs later on the page).

Command Components-
 if set to immediate and the component has an action that
returns a value for navigation, the life cycle proceeds directly to the Render Response
phase. The validation and model update phases are skipped. A Cancel button is an example of when this would be used

8). How to remove view criteria programmatically?
Ans).Vo.removeApplyViewCriteria(VOCName);

9). Explain Wsdl structure?
Ans).<wsdl:definitions.......
  <wsdl:service name="serviceMethodName">
    <wsdl:port binding="tns:serviceMethodNameSoapBinding" name="serviceMethodName">
      <soap:address location="http://service_end_point_adress"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
<?xml version="1.0" encoding="UTF-8"?>
<!--Created by TIBCO WSDL-->
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.test.com.co/BUS" elementFormDefault="qualified" attributeFormDefault="unqualified">
            <xs:include schemaLocation="../Schemas/BusApp/FirmInfo.xsd"/>
        </xs:schema>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.fixprotocol.org/FIXML-5-0" elementFormDefault="qualified" attributeFormDefault="unqualified">
            <xs:include schemaLocation="../Schemas/FIXML/fixml-allocation-impl-5-0.xsd"/>
        </xs:schema>
    </wsdl:types>
    <wsdl:service name="Service0002">
        <wsdl:port name="portTypeEndpoint" binding="tns:portTypeEndpointBinding">
        </wsdl:port>
    </wsdl:service>
    <wsdl:portType name="portType">
        <wsdl:operation name="NotificacionOperacionesRqstOp">
            <wsdl:input message="tns:firm"/>
            <wsdl:output message="tns:FIXML"/>
        </wsdl:operation>

..
..
...
</wsdl:definitions>

10). Order of client listener, server listener, action, validate listener, action listener?
Ans).client listener then validate listener then action listener then action  followed by server listener.

11). What is Association and Viewlink ?
Ans).They define the join or the link among EO’s and VO’s.Association defines link between EO’s.They can be considered as PrimaryKey/ForeignKey relationship between tables.
The Viewlink is for a VO.It defines the Join conditions.Aviewlink can be based on an association or based on attributes,viewlinks on associations have the same advantage of entity cache and few more which are unveiled later.

12). What is the Business Component Tester?
Ans).The mostly used component of the model layer is the tester, which is used to run and check the data model that is implemented.This serves as the first line of defense to see if data is exposed as we need it and to test the data model with out a need to create a UI.

13). What is task flow?
Ans).ADF task flows provide a modular approach for defining control flow in an application.Instead of representing an application as a single large JSF page flow, you can break it up into a collection of reusable task flows. Each task flow contains a portion of the application’s navigational graph. The nodes in the task flows are activities. An activity node represents a simple logical operation such as displaying a page, executing application logic, or calling another task flow. The transactions between the activities are called control flow cases

14). Advantage of Task Flow Over JSF flow?
Ans).ADF task flows offer significant advantages over standard JSF page flows
  • The application can be broken up into a series of modular flows that call one another.
  • 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
  • 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. 
15). What are type of task flow?
Ans).The two types of ADF task flow are:
■ Unbounded task flow: A set of activities, control flow rules, and managed 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 any bounded task flow.
■ Bounded task flow: A specialized form of task flow that, in contrast to an unbounded task flow, has a single entry point and zero or more exit points. It contains its own set of private control flow rules, activities, and managed beans. An ADF bounded task flow allows reuse, parameters, transaction management,and reentry. An ADF bounded task flow is used to encapsulate a reusable portion of an application. A bounded task flow is similar to a Java method in that it:
■ Has a single entry point
■ May accept input parameters
■ May generate return values
■ Has its own collection of activities and control flow rules
■ Has its own memory scope and managed bean lifespan (a page flow scope instance)
A bounded task flow can call another bounded task flow, which can call another and so on. There is no limit to the depth of the calls.
 
16). What is region in Task Flow?
Ans).You can render a bounded task flow in a JSF page or page fragment (.jsff) by using an ADF region. An ADF region comprises the following. You create an ADF region by dragging and dropping a bounded task flow that contains at least one view activity or one task flow call activity to the page where you want to render the ADF region. This makes sure that the ADF region you create has content to display at runtime

17). What is Association Accessor?
Ans).It’s an operation by which an entity instance at one end of and association can access the related entity 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.
It is described in the entity object definition xml files which can be used by view object and view link definition to specify cross entity relationship. Its return type will be the entity object class of associated entity object definition or ‘EntityImpl’ if the associated entity object definition has no entity object class.

18). What are different data control scope?
Ans).1) Isolated:
2) Shared(Default)-Data is shared with the parent flow.

19). What is Action Listener ?
Ans).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

20). What are business Component In ADF.Describe them?
Ans).ADF Business Components for your J2EE business service layer makes your life a lot easier. The key ADF Business Components components that cooperate to provide the business service
implementation are:
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.
Application Module
An application module is the transactional component that UI clients use to work
with application data. It defines an up datable data model and top-level
procedures and functions (called service methods) related to a logical unit of work
related to an end-user task.
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

21). What is Top Link?
Ans).Top Link is an Object-Relational Mapping layer that provides a map between the Java objects that the model uses and the database that is the source of their data.

22). What is Managed Bean?
Ans).JavaBean objects managed by a JSF implementation are called managed beans. A managed bean describes how a bean is created and managed. It has nothing to do with the bean’s functionality.
Managed bean is about how the bean is created and initialized. As you know, jsf uses the lazy initialization model. It means that the bean in the particular scope is created and initialized not at the moment when the scope is started, but on-demand, i.e. when the bean is first time required.

23). What is Backing Bean?
Ans).Backing beans are JavaBeans components associated with UI components used in a page. Backing-bean management separates the definition of UI component objects from objects that perform application-specific processing and hold data.

24). Difference between Backing Bean and Managed Bean?
Ans).
Backing Beans
Managed Beans
A backing bean is any bean that is referenced by a form.
A managed bean is a backing bean that has been registered with JSF (in faces-config.xml) and it automatically created (and optionally initialized) by JSF when it is needed.
The advantage of managed beans is that the JSF framework will automatically create these beans, optionally initialize them with parameters you specify in faces-config.xml,
Backing Beans should be defined only in the request scope
The managed beans that are created by JSF can be stored within the request, session, or application scopes

25). What do you mean by Bean Scope?
Ans).Bean Scope typically holds beans and other objects that need to be available in the different components of a web application.

26). What are the different kinds of Bean Scopes in JSF?
Ans).JSF supports three Bean Scopes -
Request Scope: The request scope is short-lived. It starts when an HTTP request is submitted and ends when the response is sent back to the client.
Session Scope: The session scope persists from the time that a session is established until session termination.
Application Scope: The application scope persists for the entire duration of the web application. This scope is shared among all the requests and sessions.

Guys I'll share more QA in my next post.

Cheers :)

Eclipse With Python

Hi Guys, Today i'll share how to start python project in eclipse IDE. to start Py development in eclipse we need to add Py Dev plugi...