About Importing Business Components

There are a number of scenarios where you may want to import existing business components. For example, you may want to base your business components project on an existing application, or you may have two more more separate projects that you want to merge into one project. Depending on your needs, there are two ways to import the existing business components: as read-only files from a JAR or Zip file, or as mutable source files.

About Importing JAR or Zip Files

You can build extended business components in nearly the same way that you build extended Swing classes. You extend Swing classes by adding the Swing JAR file to your project's library list and creating your new derived classes by extending the classes delivered in the Swing JAR file. You build extended business components by adding the JAR file of business components (.class files and .xml metadata) to your project's library list, and extend the components in the same manner.

As is typical with other archives, the "runtime" JAR file does not have the source in it. The application supplier might choose to make source available separately or not. Again, exactly like the Swing example, the source is not required to extend the base classes.

The JAR file containing the package of original components will serve as the base for the extended components. The developers who will be customizing the components, must define a library for the JAR file and add it to the library list for the project. The package of original components then must be imported into the project that will house the extended components. Within this project, a package must be created to house the extended components.

Maintaining separate packages for the existing and extended components allows customization to be performed without the danger of modifying the existing components. When a library is imported into your project, all of the contents of the library are read-only. This is to protect you from accidentally modifying the metadata of the delivered components.

About Importing XML Source Files

If you need to import mutable files, then you must import the source files directly. Files imported this way are treated the same as any other source file in your project.

Related Topics:

Importing Business Component XML Files from Archives
Importing XML Source Files
About Importing Business Components
Creating a Library for the JAR File
Creating a JAR File
Import Project Wizard