- Oracle JDeveloper 11gR2 Cookbook
- Nick Haralabidis
- 603字
- 2021-08-20 15:53:00
Setting up BC base classes
One of the first things to consider when developing large-scale enterprise applications with ADF-BC is to allow for the ability to extend the framework's base classes early on in the development process. It is imperative that you do this before creating any of your business objects, even though you have no practical use of the extended framework classes at that moment. This will guarantee that all of your business objects are correctly derived from your framework classes. In this recipe, you will expand on the previous recipe and add business components framework extension classes to the SharedComponents
workspace.
Getting ready
You will be adding the business components framework extension classes to the SharedComponents
workspace. See the previous recipe for information on how to create one.
How to do it…
How it works…
Defining and globally configuring business components framework extension classes via the ADF Business Components Base Classes settings on the Preferences dialog causes all subsequent business components for all projects to be inherited from these classes. This is true for both XML-only components and for components with custom Java implementation classes. For XML-only components observe that the ComponentClass
attribute in the object's XML definition file points to your framework extension class.
There's more…
You can configure your business components framework extension classes at two additional levels: the project level and the individual component level.
- Configuration at the project level is done via the Project Properties Base Classes selection under the ADF Business Components node. These configuration changes will affect only the components created for the specific project.
- Configuration at the component level is done via the component's Java Options dialog, in the component's definition Java page, by clicking on the Classes Extend… button and overriding the default settings. The changes will only affect the specific component.
Note
Do not attempt to directly change or remove the
extends
Java keyword in your component's implementation class. This would only be half the change, because the component's XML definition will still point to the original class. Instead, use the Classes Extend… button on the component's Java Options dialog.
Finally, note that the default package structure for all business components can also be specified in the ADF Business Components | Packages page of the Preferences dialog.
See also
- Creating and using generic extension interfaces, Chapter 5, Putting them all together: Application Modules
- Breaking up the application in multiple workspaces, in this chapter