Saturday, 26 September 2015

ADFBC base classes


Inroduction

ADF business component is ADF framework that we can use in Model view. It manages connection with database.
It is ready developed and you can customize it to get your customized framework.
It is contains several main classes that are essential for Model components that are illustrated in below picture.
For opening the below window Open Jdeveloper>Tools>Preference

As we noticed there are classes dedicated to Entity Object, View Object, Application Module.
ADFBC Framework classes
EntityCache
    It maintains the entity cache and it has the updated values for each entity row.When ever an attribute is changed at the end its pushed to the entity cache.

EntityImpl
   It has generic getAttribute and setAttribute methods to set or get any attribute.When ever a separate implementation class is generated for an Entity Object the class extends EntityImpl and custom get and set methods can be generated in the extension class.This can be controlled from JDeveloper by selecting Generate accessor checkbox.

ViewObjectImpl
   It represents a VO.It has all the information related to the VO level like bindVariables,query etc.When ever a VO is executed to get results,The ViewObjectImpl's executeQuery or executeQueryForCollection method gets invoked.

ViewRowImpl
     It is a representation of a VO row or the result row.Similar to getAttribute and setAttribute in EO,get and set methods specific to each attribute can be generated in VORowImpl too.

ApplicationModuleImpl
     It has the Application Module related methods like beforeCommit,afterCommit etc.


Friday, 25 September 2015

Different types of data controls(DC) in ADF

1. ADFBC (default)
2. POJO DC
3. Webservices DC
4. URL services DC
5. Place holder DC
6. EJB Dc
7. JMX DC

Task flow components

1. Method call
2. parent action
3. router
4. save point restore
5. task flow call
6. task flow return activity
7.url view
8. view 
9. control flow case
10. wild card control flow rule

ADF Life Cycle

In Oracle adf life cycle we have different phases are there 

1) Restore View/Initialize Context: In case of post request view is restore view. In this request from a page is passed to bindingContext, which finds the page definition file that matches the URL.

                        If page is not loaded earlier view is initialized. bindingContainer object which is the run time representation of the page definition file. Life cycle context which stores the information about adf life cycle.


2) Prepare model: In this model prepares and initializes. In this bindingContainer prepares and evaluates any page or Taskflow parameters and executes them. 

3) Apply input values: Whatever values we enter in the input text, those values can be mapped with bindings  in the page definition file and those values gets stored in the temporary location/string.

4) Validate input values/Process validations: In this validations are takes place ie temporary string values is converted to the correct type.

5) Update model values: The component values are updated in the model and local values are discard.

6)Validate model values: Updated value is validated even in the entity level.

7) Invoke application: After bradcast root components, it executes action and actionListener methods

8) Metadata commit: This phase commits the runtime metadata changes to the model. It always executes before render response

9) Prepare render and Render response: This is the final phase is sent for rendering. Prepare render is sent for all the registered listeners. BindingContainer also refreshed.

                             This helps in updating any changes that happened  during validation process. and finally page is build