114 Using VisualAge for Java Enterprise Version 2 to Develop CORBA and EJB Applications
Figure 40. New EmployeeID Object in the Component Broker Object Architecture
As you can see, you have to model your design, using the Component Broker
frameworks.
13.2.2 Object Builder Tool.
The Component Broker frameworks and Component Broker toolkit provide
the development environment to adapt your objects to the Component Broker
runtime. Object Builder is the main development tool in Component Broker.
With Object Builder, you can create the interfaces, IDL files, implementations,
and all language-specific files for running your application on the client and
the server. You can define the persistence policy of your objects, mapping
their essential state to data stores, which can be DB2 or other databases. All
the class and method implementations of the Component Broker frameworks
needed to manage your objects by the system are included and defined
within Object Builder. When you have defined the interfaces of your
application, you can generate the language-specific source files and all files
needed by the Component Broker runtime.
Component Broker Development Process 115
Using Object Builder, you define the methods and the attributes of your
interface. Once you have implemented the interface’s methods, with some
additional information provided by you, Object Builder generates all the files
for managing the persistence of the object, such as Data Object (DO) and
Persistent Object (PO), the schema mapping, the implementation of the Key
and Copy helpers, and all of the C++ code needed to wrap your Java object.
With Object Builder, you also define the behavior of the container in which all
instances of your classes live. By packaging all generated code in shared
libraries and Java jar files, Object Builder makes your object manageable by
the Component Broker runtime and thus it can be used remotely by a client
application.
Using the Object Builder user interface, you generate the files simply by
selecting the Generate option in the opened pop-up menu from the User-
Defined Business Objects folder. After that, you can build the application by
selecting Generate All -> Java Default Target in the opened pop-up menu
from the Build folder. Object Builder generates all the files and builds the
required DLLs and jar files, hiding all details about the way it does that. Thus
you can focus on the main problem: the business logic.
Object Builder stores all of the generated files in a directory named with the
same name of your project. In our sample, we have a project named
employeeApplication, so Object Builder creates the
employeeApplication
directory, and two subdirectories,
working
and
model
. In the model
subdirectory, Object Builder stores the UNI model. In the working\nt
subdirectory (if you develop on the NT platform) are all of the generated files
needed to build the DLLs, jar files, and configuration files. Some of these files
are used by the System Manager to load the application.
In your EmployeeID sample, for your business logic the Object Builder
generates the files listed in the Figure 41 on page 115 in the working
directory.
Figure 41. Object Builder Generated Java Files
_EmployeeIDBOBase.java
EmployeeIDKeyHelper.java
EmployeeIDKeyImpl.java
EmployeeIDCopyHelper.java
_EmployeeIDCopyImpl.java

Get Using VisualAge for Java Enterprise Version 2 to Develop CORBA and EJB Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.