Skip Headers
Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers
10g (10.1.3.1.0)

Part Number B25947-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

4.6 Overview of ADF Business Components Design Time Facilities

JDeveloper offer broad design time support for ADF Business Components. This section highlights the facilities you'll be using throughout the guide to work with your business components.

4.6.1 Choosing a Connection, SQL Flavor, and Type Map

The first time you create a component, you'll see the Initialize Business Components Project dialog shown in Figure 4-7. You use this dialog to select a design time database connection to work with while working on your business components in this project. The Connection dropdown list shows a list of all the named connection definitions you've created, or clicking New... allows you to create a new one if you don't see the one you need.

Figure 4-7 Initialize Business Components Project Dialog

Image shows Initialize Business Components Project dialog

The SQL Flavor setting controls the syntax of the SQL statements your view objects will use and the syntax of the DML statements your entity objects will use. If JDeveloper detects you are using an Oracle database driver, it defaults this setting to the Oracle SQL flavor. The supported SQL flavors include:

  • Oracle — the default, for working with Oracle

  • OLite — for the Oracle Lite database

  • SQLServer — for working with a Microsoft SQLServer database

  • DB2 — for working with an IBM DB2 database

  • SQL92 — for working with any other supported SQL92- compliant database

The Type Map setting controls whether you want this project to use the optimized set of Oracle data types, or use only the basic Java data types. If JDeveloper detects you are using an Oracle database driver, it defaults this setting to the Oracle Type map. The supported type maps are:

  • Oracle — use optimized types in the oracle.jbo.domain package

  • Java — use basic Java types only


Note:

If you plan to have your application run against both Oracle and non-Oracle databases, you should select the SQL92 SQL Flavor when you begin building your application, not later. While this makes the application portable to both Oracle and non-Oracle databases, it sacrifices using some of the Oracle-specific optimizations that are inherent in using the Oracle SQL Flavor.

4.6.2 Creating New Components Using Wizards

In the New Gallery in the ADF Business Components category, JDeveloper offers a wizard to create each kind of business component. Each wizard allows you to specify the component name for the new component and to select the package into which you'd like to organize the component. If the package does not yet exist, the new component becomes the first component in that new package. The wizard presents a series of panels that capture the necessary information to create the component type. When you click Finish, JDeveloper creates the new component by saving its XML component definition file. If you have set your Java generation options to prefer their generation by default, JDeveloper also creates the initial custom Java class files.

4.6.3 Quick-Creating New Components Using the Context Menu

Once a package exists in the Application Navigator, you can quickly create additional business components of any type in the package by selecting it in the Application Navigator and using one of the options on the right-mouse context menu as shown in Figure 4-8.

Figure 4-8 Context Menu Options on a Package to Create Any Kind of Business Component

Image of context menu options in Application Navigator

4.6.4 Editing Components Using the Component Editor

Once a component exists, you can edit it using the respective component editor that you access by either double-clicking on the component in the Application Navigator or selecting it and choosing the Edit option from the right-mouse context menu. The component editor presents a superset of the panels available in the wizard, and allows you to change any aspect of the component. When you click OK, JDeveloper updates the components XML component definition file and if necessary any of its related custom Java files.

4.6.5 Visualizing, Creating, and Editing Components Using UML Diagrams

As highlighted in the walkthrough in Chapter 2, "Overview of Development Process with Oracle ADF and JSF", JDeveloper offers extensive UML diagramming support for ADF Business Components. You can drop existing components you've already created onto a business components diagram to visualize them, use the diagram to create and modify components, or a mixture of the two. The diagrams are kept in sync with changes you make in the editors.

To create a new business components diagram, use the Business Components Diagram item in the ADF Business Components category of the JDeveloper New Gallery. This category is part of the Business Tier choices.

4.6.6 Testing Application Modules Using the Business Components Browser

Once you have created an application module component, you can test it interactively using the built-in Business Components Browser. To launch the Business Components Browser, select the application module in the Application Navigator or business components diagram and choose Test... from the right-mouse context menu.

This tool presents the view object instances in the application module's data model and allows you to interact with them using a dynamically generated user interface. This tool is invaluable for testing or debugging your business service both before and after you create the view layer of pages or Swing panels.

4.6.7 Refactoring Components

At any time, you can select a component in the Application Navigator and choose Refactor > Rename from the right-mouse context menu to rename the component. You can also select one or more components in the navigator — by holding down the [Ctrl] key while you select with the mouse click — and choose Refactor > Move to move the selected components to a new package. References to the old component names or packages in the current project are adjusted automatically.