If you’re thinking about reusability in your ADF application (and you should be!), you might have taken a look at using ADF Libraries. These are a special type of JAR file that allows ADF Business Components (EOs, VOs, AMs) or ADF Faces Components (page templates, task flows, declarative components) to be reused in other applications. When validating Dede’s new ADF Insider Essential on the topic, I found that it’s imperative that you use unique naming conventions for the project. More specifically, if you are prototyping this feature and create an Application that uses the default Model and ViewController project names (and the corresponding packages of the same names), you’ll be able to add ADF Library JARs containing components from those projects to projects in another application, but you won’t be able to reuse any of the components. So to set this up correctly, follow these steps:
- Create a base Application named anything you like. If you choose the Fusion Application Template, you’ll be prompted to add two projects, Model and ViewController, to the Application in a wizard.
- In Step 2 of 5 in the wizard, name the Model project BaseModel and in step 3 of 5, provide a package name of basemodel (or some unique name).
- Repeat this for Steps 4 and 5, providing a unique name for the ViewController project
- Create reusable components for your organization’s use. If you are just prototyping this, you might create a full set of ADF Business Components in the BaseModel project, and a page template and the traditional ADFUtils and JSFUtils helper classes in the BaseViewController project.
- Create a New ADF Library JAR deployment profile for each project and deploy the JAR files.
- Create a new application, using the default project and package names, and either use the Resource Palette to add the JARs to the projects or for Business Components, use Project Properties > Business Components > Imports to add the components to the new project.
The key to all this is that if you fail to change the name of the project, adding the JAR to the project using either method will be a no-op and you won’t see your BC or ADF Faces components reused in the ‘consuming’ application.
Note: In JDeveloper 188.8.131.52, when you change the name of the project in steps 2 and 4 of the wizard, the name of the package isn’t changed from the default in steps 3 and 5. This is a regression in behavior so I’ve filed a bug for that.