User's Guide
To illustrate the steps required to package applications as one or more
ICs, this section provides a simple example designed only to illustrate the IC
packaging process. The example is a simple to-do list comprised of two
applications:
- IcTestView provides a user interface and simple to-do list
capabilities.
- IcTestModel provides the domain model, in this simple case, a
model of the objects contained in the to-do list.
To create the to-do list example, perform the following steps:
- In the VisualAge Organizer, create two applications, IcTestView
and IcTestModel.
- Select IcTestModel and create a new nonvisual part, called
Thing. In the Public Interface Editor, give it one attribute
called name, generate the default scripts, and save the
part.
- Define the instance method printOn: for Thing
to be something like the following, so text is shown correctly in the user
interface:
printOn: aStream
aStream
nextPutAll: self name;
nextPutAll: ' thing'.
- Select IcTestView and create a new visual part called
ToDoListView.
- Add three Push Buttons, a Text part, a Multiple Select List, an
OrderedCollection, and an Object Factory. Label the three push buttons
Add, Delete, and Exit. Set the Object
Factory's instanceClass property to Thing.
- Tear off the instance (Thing) attribute of the Object
Factory.
- Make the following connections:
- Connect clicked of Add push button to new
of Object Factory.
- Connect object of Text part to the name attribute of
Object Factory.
- Connect clicked of Add push button to
add: of OrderedCollection.
- Connect the self attribute of instance of Object Factory to
anObject of the clicked-add: connection.
- Connect clicked of Delete push button to
removeAll: of OrderedCollection.
- Connect selectedItems of Multiple Select List to
aCollection of the clicked-removeAll:
connection.
- Connect clicked of Exit push button to
closeWidget of Window.
- Connect self of OrderedCollection to items of
Multiple Select List.
Your visual part now resembles:

Save the part and test it to ensure it works correctly.
Next, complete two steps described in Packaging preparation: load configuration maps and set the correct
prerequisites.
Verify the prerequisites for IcTestView because it uses the
Thing class defined in IcTestModel. That is,
ensure that IcTestView specifies IcTestModel as a
prerequisite.
Test your application once again to ensure you've made these changes
correctly. Also, before packaging these two applications as ICs,
version and release the classes and version the applications. You
should also unload and load your application to ensure you've defined the
application class methods correctly.
Finally, create an application called
IcTestPackagingInstructions with an immediate prerequisite of
EpImageInstructions. This application will contain the
packaging instructions.
The next four sections go through four examples of creating ICs, starting
with the simplest example and progressing through more complex ones.
The examples include:
- Creating a leaf IC
- This example involves packaging the To-Do List as one leaf IC.
- Creating a reusable and a leaf IC
- This example involves packaging IcTestModel as a reusable IC
and IcTestView as a leaf IC. The leaf IC will include the
reusable IC as a prerequisite.
- Creating ICs to be explicitly loaded
- This example involves packaging the To-Do List as an IC and another sample
application provided by VisualAge for Smalltalk as an IC. We'll
then create another example application, a simple desktop launcher, to
dynamically load and unload these ICs.
- Creating a platform-dependent IC
- This example involves a slight modification of your To-Do List example to
make it platform dependent. We'll package IcTestModel
and IcTestView as two platform dependent leaf ICs, one for Windows
and one for OS/2.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]