When we work on ADF components,
we may want to reuse them across different projects, applications and teams.
Oracle ADF and JDeveloper support to package reusable components and associated
artefacts into an ADF Library JAR. An ADF Library JAR is a special JAR
containing ADF components and appropriate control files for the components.
We can reuse the below adf components in many other
applications.
>Data control
>Application module
>Business components
>Task flows and task flow templates
>Page templates
>Declarative components
Example to Reuse Bounded task flow in other application.
Creating ADF Library Jar File.
1. Create
ADF application with the required Business components, page templates and
bounded task flows with a proper naming conventions by avoiding default names
for model project, view Controller project and paths.

2. Design
a proper bounded task flow for each functionality so that we can create a regions
and dynamic regions in another application with help of this. Create all
necessary business components, pages and business logic.

3. Save
DataBindings.cpx file as with proper naming in the same path and edit the new
file and replace id value with latest file name. Delete the old DataBindings.cpx
file.


4.
Edit the adfm.xml file to with new DataBinding
file name.

5. Package
the application into ADF Jar file by building the new deployment profile using
View Controller Project >Deploy>New Deployment Profile. Make sure to
include Model project as dependency.

6. Deploy
the View Controller project with newly created deployment profile to get the
Jar file.
Now we can use
this jar in another application to reuse the existing components.

Using the Created Library file in new Application.
1.
Create a new file system in Jdeveloper using
Resource pallet which will direct to the available ADF Library Jar file.

2.
Create a new ADF Fusion Web Application and
select the view project to add the library from the File System by right
clicking on available jar file.

3.
Modify the Database connection properties if you
are not using server data source or create a same data source in the server
with same name as Library file data source.

4.
Now all the components from ADF library files
are available to use in the new application.

In this way we can re-use the adf components from one application
to another application with proper design.