Tool Mentor: Understanding Object Builder Cross-platform ConsiderationsPurposeObject Builder (OB) is a powerful tool that allows for multi-platform development. Using the Object Builder tool running on Windows NT, you can generate and deploy code that will be compiled and then executed on some other platform, such as AIX, Solaris or OS/390. Most development options are the same for all platforms; significant differences appear when you generate the code for your components. There are three mechanisms in place for dealing with these differences: platform-filtered views, platform-targeted code generation, and platform-specific development constraints. You can also implement different versions of your method implementations for different platforms. Related Rational Unified Process activity: Activity: Implement Component OverviewApply the constraints and views judiciously the first time. Thereafter, refrain from changing these settings. Platform-specific, data object implementations can be part of your model.
Tool StepsThere are four ways to manage the platform-specific code generation features of Object Builder: 1. Views
In Object Builder you can filter the view so you only see those things that are relevant to the platform you are targeting. Inheritance options, framework methods, and framework method implementations will be filtered for the selected platform. The information for all views is stored in the same project model and you can switch between views at any time. To filter the platform views, from the Object Builder menu, select Platform > View. 2. Code Generation
In Object Builder you can select the target platform for which you wish to generate code. For each platform you select, an equivalent subdirectory will be added to the project's \Working directory. For example, if you select AIX and 390, you will have code generated to the directories <project>\Working\AIX and <project>\Working\390. Each time you select a Generate option from within the Tasks and Objects pane, code will be generated for all selected platforms. The more platforms you select to generate for, the longer code generation will take. To select the target platforms, from the Object Builder menu, select Platform > Generate. 3. Constraints
In Object Builder you can set constraints to ensure that the components you develop will be deployable on your target platforms. By default, any components you develop will be deployable on the platforms you selected. You can override these defaults on a particular object to create a platform-specific version of the object. To set the platform constraints, from the Object Builder menu, select Platform > Constraints. You can also set object-specific platform constraints on business object interfaces, business object implementations, data object interfaces, data object implementations, managed objects, containers, and DLLs. For containers and DLLs, you can set the constraints either when you create the object or when you edit its properties (select Properties from the object's pop-up menu). For the other objects, you can set the object-specific platform constraints either when you create the object or when you edit its file properties (select File Properties from the object's pop-up menu). On the first page of the object's wizard (if you are creating the object, or if you are editing containers and DLLs), or the object's File wizard (if you are editing the object's file), in the section Deployment Platforms, you can select a subset of the platform constraints to apply. For example, if your platform constraints are set to AIX and 390, you can specify one of the following sets of deployment platforms:
4. Methods
In the Properties wizard for a method, you can define whether its implementation in the Source pane is to be used for all platforms or to be defined separately for each platform. To set the method implementation, from the methods pane in Object Builder, select Properties
from the method's pop-up menu. Once you've set the method properties to use different
versions, select the This information is provided by IBM
Corporation
© Copyright IBM Corporation 1999-2000 |
|
Rational Unified
Process |