An image component is a portion of an image. If a VA Smalltalk development or reduced runtime image file were arbitrarily partitioned into separate files, the objects present in a particular file would not be able to perform computational processing by themselves, because they would quite likely be dependent on objects and classes that would be available only in another IC. For example, OrderedCollections require
Arrays to perform their behavior. If an image were arbitrarily partitioned so that
OrderedCollections were put in one IC and
Arrays were put in another, then the IC containing the
OrderedCollection could not operate unless the IC containing
Arrays was also available in memory. In other words, one cannot arbitrarily divide an image into ICs; the ICs are related. This relationship between ICs takes the familiar form of prerequisite/dependent. An IC containing
OrderedCollections needs an IC containing
Arrays as a prerequisite to allow the behavior of the
OrderedCollections to operate properly. In practice, ICs are used to decompose systems into finer grained functional components. It is therefore natural to see ICs representing characteristics of a system such as communication capabilities, database capabilities, national language support, external program invocation, and Lotus(R) Notes(TM) support.
When a reduced runtime image file is loaded into memory by abt.exe, the memory is associated with the same operating system process that is running
abt.exe. In other words, if two instances of an application are started, by invoking
abt.exe twice (which in turn, causes two operating system processes to be started, one for each invocation), the memory used by each reduced runtime image when it is loaded is not seen nor shared by the other invocation of
abt.exe. The in-memory images occupy completely different memory address spaces (ranges). The memory occupied by the reduced runtime image is process protected; an attempt to address a portion of a loaded reduced runtime image from another operating system process, usually results in a memory address fault at the operating system level.
ICs provide an alternative deployment mechanism that facilitates sharing of these common objects for multiple abt.exe invocations. This is accomplished by recognizing that certain objects within a deployed runtime image are common to all VA Smalltalk applications and that these objects are unchanged by the application when it is running.
Classes and
CompiledMethod instances are not changed by runtime applications. Runtime applications do not alter class definitions or hierarchies and do not alter bytecodes in
CompiledMethods. Objects that are unchanged by applications using them can be characterized as read-only objects or ROM objects. The term ROM object emphasizes the fact that these objects do not change and could theoretically be placed in Read Only Memory (ROM). Since the ROM objects are unchanged by the applications that use them, they can be shared by multiple VA Smalltalk application invocations. To accomplish this, they need to be placed in special memory which can be shared between processes at the operating system level. All modern operating systems support the notion of shared memory spaces. The VA Smalltalk virtual machine takes advantage of the operating system shared memory support to reduce the combined memory footprint of multiple invocations of a VA Smalltalk application.
The maximum amount of object sharing that can take place for multiple uses of an IC is equivalent to the size of memory occupied by the ROM objects, as this is the only portion of the IC that is shareable. However, IC images are not reduced like reduced runtime images. For a given application, it is possible to determine the minimum set of objects required to produce a reduced runtime image, because the context in which the objects are used is fully determined by the VA Smalltalk packager algorithm. For ICs, this reduction cannot be performed because the application context in which the IC code will be used is unknown at the time of packaging. This means that for an IC, all the objects present within the original Applications are packaged into the IC, either in ROM or RAM space. When the IC is loaded into memory, these objects will take up space whether they are needed by the application using the IC or not. Herein lies the basic memory trade-off when using ICs compared to reduced runtime images: ICs allow sharing of a subset of their objects (ROM) for multiple invocations of VA Smalltalk runtime applications, but there is no guarantee that objects loaded into memory will be used. Reduced runtime images do not allow sharing of objects between multiple invocations, but any objects that are not used by the application have already been removed by the VA Smalltalk packaging process. If you ever run a single invocation of a VA Smalltalk built application on your workstation, the reduced runtime image will result in the smaller memory footprint, as only the objects actually being used by the application are loaded into memory.
You need to specify only myapp.ic as the IC to use to start your application. You do not have to specify any of the other ICs. This is because
myapp.ic knows about its prerequisite ICs and before it is loaded into memory, its prerequisite ICs are first loaded. Loading an IC into memory causes both its prerequisites and itself to be loaded. This automatic process of loading prerequisites is known as implicit binding. Implicit binding is not demand loading. Implicit binding takes placed either when an application is started for a specific initial IC or image file, or when an IC is explicitly loaded using code within application code.
Using an .icx image file to launch the application results in a quicker startup time, but deploying changes to the application into the field is slightly more complex. A previously deployed
.icx image will not work with changed application ICs, because the
.icx image expects to run with the exact ICs from which it was created. In a deployed environment, the image file must first be re-created to reflect changes to application ICs, by using the
-se command line option mentioned above. Invoking VA Smalltalk with the
-se command line option could be accomplished by using a command file that is supplied by the development team as part of the installation process. The extra steps involved in deploying the application are certainly worth the increase in performance obtained by using an
.icx image file for launching the application.
The actual name of the .ini file that is associated with the IC or image file name that starts the application. Because the default image is
abt.icx, the corresponding
.ini file is
abt.ini. If you rename the image, then you should also rename the corresponding
.ini file. For consistency, it is best to name the
.exe,
.ini, and startup
.ic files that represent the application with the same file name.
Within the abt.ini file, you can specify a logical IC name to full directory and file name mapping so the actual IC that is loaded as a prerequisite can easily be changed by changing the
abt.ini file and directory structure. This alleviates having to repackage a dependent IC only because one of its prerequisite IC files has changed name or directory location.
Using the path structure for application maintenance: By providing a logical-to-physical name mapping within the
.ini file, VA Smalltalk allows for great flexibility in delivering updated ICs into both production application environments and development environments. For example, a quality assurance team could switch testing between several environments (production, preproduction, development) simply by altering the
.ini file that they use to start the application. Each
.ini file maps logical IC names to a different set of ICs within different directories on the network. Each directory structure could contain the software for a different release. Since the physical file name of the IC can be different from the logical name, the physical file names can also embody version numbers within their names to help ease the diagnosis of application installation problems (
kernel45.ic for example).
The second location that is checked is the same directory where the application IC resides. For example, if an application is started by invoking abt -imyapp.ic where
myapp.ic represents the application IC, the loading process will first search for prerequisite ICs in the same directory as
myapp.ic. This is similar to the situation in VA Smalltalk 9.2.0 running on Windows platforms, where the DLLs associated with the
abt.exe executable were contained in the same directory as the
abt.exe file. So, if
myapp.ic has
prereq.ic as a prerequisite, then the loading process would first search for
prereq.ic in the same directory as
myapp.ic. The full IC name of the prerequisite IC including the
.ic suffix is contained within a dependent IC. However, the
.ic suffix is a convention. You are free to use any file name.

The third and last location that is checked is a default directory specified in the abt.ini file. Within the
abt.ini file you can also specify a single default directory location to be searched for ICs. Within the IC Path section of the
abt.ini file, you can specify an entry that identifies the default IC directory. This entry is provided in the
abt.ini file shipped with the product and identifies the location of all product ICs. For example, nearly any application IC you build will have one or more product ICs as prerequisites. You can use the
abt.ini file to identify the location of those prerequisite ICs. For information on specifying a default directory in the
abt.ini file, see
Image component (IC) mapping.
Also, loadComponent: and
removeComponent: cannot be issued from a reduced runtime image, because the necessary prerequisite ICs cannot be loaded or are not available in this environment.
|
1.
|
The initializeAfterLoad message is sent to all the newly loaded classes.
|
|
2.
|
The loaded method is sent to the Application or SubApplication in their prerequisite order.
|
During the packaging process to create an IC, you can set the startUpClass for the IC. Since there can be only one
startUpClass for an image, the
startUpClass will be that of the "leaf" IC (the one that does not have any dependent ICs associated with it). In other words, for implicit binding of ICs, the
startUpClass specified as part of packaging the IC can be overridden by a dependent IC. The
startUpClass is ignored if an IC is being loaded as the result of an explicit bind (using
System instance method
loadComponent:).
In this document, a capitalized Application implies an application as seen from the Application Manager. An uncapitalized
application implies a software deliverable with which the end user interacts.
Copyright 2005, 2019 Instantiations, Inc. All rights reserved.