Application Deployment Tutorial


This is a simple tutorial based on a "Hello World" application that can be used to demonstrate how to use Dolphin's application deployment features. Install the package Hello World.pac from the Samples\Hello World directory and read the package comment. If you have not already done so, you should first read the overview about the application deployment process and strategies.

Non-Packaged Instance Based Deployment

To illustrate this mode of deployment just assume for the moment that the HelloWorld class is not actually contained in any package. Display an instance of this class by evaluating:

HelloWorld new show

The following window should appear.

Try clicking in the client area of the window and you should see a #doesNotUnderstand: Walkback appear for the message #fail. This is a deliberate bug that has been coded in the HelloWorld class so that we can later illustrate how such a situation is handled in a run-time application. Terminate the Walkback to continue with the tutorial.

Now we are going to deploy the application. Close all other windows that are not Dolphin tools and, making sure that the Package Browser is not selected, choose Tools/Application Deployment Wizard to invoke the Application Deployment Wizard.

In Step 1 enter the name of a suitable executable file to be generated, say HelloWorld.exe. Step through all the subsequent pages using the Next button until you reach Step 6. You can leave all the options at their default settings. On the way though, in Step 2, note that the Strip redundant classes option is not available. This is because we are deploying the application without a root package. In such cases the ImageStripper is not be able to determine a sensible set of redundant classes that can be safely removed. This will end up with the resultant executable being larger than if we were deploying directly from a root package.

In Step 6 press the Deploy button. This will start the image stripping process and eventually create the executable for our "Hello World" application. During the process all the Dolphin tool windows will be closed and a progress dialog will appear to report on the stripping activity. The overall deployment process may take several minutes depending on the speed of your machine; for example on a P120 a time of around three minutes is to be expected.

The resultant executable size should be around 1.31Mb (reported by Dolphin Smalltalk/98 release 1). Double-click the executable to invoke the "Hello World" window. Try clicking the mouse in the client area again. This time you'll notice that you do not get a Walkback but merely a simple message box to indicate the message not understood error. This is due to the fact that all the development tools have been stripped from the image and are therefore not available at run-time. As you might imagine this can make debugging a run-time session system a little harder than in the development environment.

If you wanted to distribute this application to a target machine you would need to copy and install HelloWorld.exe and the Dolphin Virtual Machine DLL, DolphinVM981.dll. The latter can be found in your windows System directory. Note that subsequent releases of Dolphin will have different version numbers for the VM DLL.

Packaged Instance-Based Deployment

Restart the Dolphin development environment. The HelloWorld window should still be visible but if it is not then open another as before. Now we'll demonstrate deploying the application based on a root package. This should allow the ImageStripper to remove more classes and produce a smaller executable file than before. Open the Package Browser and select the Hello World package. Now invoke the Application Deployment Wizard from the Tools menu.

Once again, enter an executable name in Step 1. Also check that the RuntimeSessionManager to install option is set to RuntimeSessionManager and move on to Step 2. Now you'll notice that the Strip redundant classes option is available and checked. Skip onto Step 6 and press Deploy to commence the stripping process once more. This time the process will take slightly longer since more classes are being removed from the image.

The resultant executable size should be around 1.21Mb (reported by Dolphin Smalltalk/98 release 1). As you can see this is a saving of around 100K when compared with the previous non-packaged method of deployment. Obviously such executable sizes will vary widely depending on the complexity of the application and the size of the original development image. For the example sizes given here the original image was 2.2Mb which indicates that the stripping process removed just under 1Mb of redundant objects.

Packaged Class-Based Deployment

In some situations it is not viable to create an instance of your application to be saved as part of the deployed image. In these cases you will need to install a new subclass of RuntimeSessionManager that invokes your application as part of its start up processing.

Restart Dolphin and close the instance of HelloWorld that you previously created. Take a look at the Hello World package and you'll see that it includes a class called HelloWorldSessionManager. This has not been relevant to the previous two deployment examples but now take a look at its #tertiaryStartup method in the Class Browser. This method will be called during the final stages of image startup and you can see that its purpose is to create a suitable instance of the application window.

Open the Application Deployment Wizard from the Package Browser as you did in the previous example. The package should have remembered the ImageStripper options (such as the executable name) that you specified last time. However, now use the drop-down list in Step 1 to choose HelloWorldSessionManager as the RuntimeSessionManager to install. Then proceed to Step 6 to deploy the application.

Once again, the resultant executable will be around 1.21Mb and you can test the results, which should be nothing remarkable, by double-clicking the executable file.