For each object registered, ZOM records several properties that identify the object and track the object’s state. Some of these properties are set automatically by ZOM, while others are designated manually by the user. These properties are then used by the ZOM services in processing objects and can be used by you to select the objects to process.
Identification Properties
The identification properties ZOM can use to identify an object are
ObjectKey
A globally unique identifier for the object
ObjectName
The name of the object
ObjectType
The type of the object
OwnerName
The name of the owning object
DirName
The name of the directory containing the object
Keywords
User-defined keywords that identify or classify the object
Status Properties
The status properties ZOM uses to record the state of an object are
Defined
Indicates if the object is described in the Object Dictionary
Exists
Indicates whether the object is created
Active
A user-designation indicating whether the object is available for processing by the ZOM services. Initially, the active property is set automatically for all objects.
Locked
A user-designation indicating the object’s definition cannot be changed using the ZOM services
Data
Indicates if the object can have data records (i.e., an EntitySet or relationship with fields)
DataSave
A user-designation indicating if an entity set or relationship object should preserve or discard its data records when the definition changes.
Selected
A user-designation indicating if the object is considered “selected” by the user according to some user-defined criteria.
Compilable
A user-designation indicating if a document object is a compilable program.
CompileStatus
Indicates if a compilable document object is compiled or needs to be recompiled.
Properties are set at different times and in different ways. The identification properties, with the exception of Keywords, are set initially by ZOM when an object is registered and maintained automatically by ZOM. Keywords are assigned to objects explicitly by the user. The status properties, with the exception of user-designated properties, are set by ZOM when an object is touched. These properties are also automatically updated by ZOM when a ZOM service changes the object’s state. The user-designated properties are explicitly set by the user.
ZOM is an integrated component for object management. It is highly recommended that it remains on permanently to obtain the benefits of analyzing and manipulating objects. If you are using ZOM on the command line, you must first enable ZOM before using any of the object management services during a Zim session. This is done by invoking ZOMEnable as shown in the following example:
ZOMEnable
This procedure initializes the ZOM for the session and searches its Object Dictionary for any objects that are unknown to the ZOM. These objects are automatically “registered” in the ZOM object database. (The registration of the object is described later in this section.)
If you plan to make regular use of ZOM from the command line, it is recommended to run ZOMEnable in your startup program (ie, ZimPROF) while developing an application.
If, during a session, you want to shut down ZOM, issue the ZOMDisable command as shown in the following example:
ZOM keeps track of two types of information about objects:
object attributes such as the object’s name and type
object dependencies such as the fact that a program uses (i.e. refers to) other objects
Because object descriptions can be added to the object dictionary at any time, when you invoke a ZOM command, ZOM does a quick check for new objects. New objects are “registered”, meaning they are assigned a unique object key and are known to ZOM. Dependency information is updated by ZOM commands that can change dependencies (e.g. ZOMCompile and ZOMReCreate). Of course, you can still create and compile using the regular Zim commands, meaning that ZOM’s dependency information can be out-of-date. The ZOMTouch command can be used to examine objects and update the dependency information.
With that in mind, the first time you use the ZOM, you will need to make the ZOM “aware” of the objects in your application. The simplest way to do this is to “touch” all objects in your application using the ZOMTouch command.
For each object encountered, ZOMTouch records information such as the object’s name, type, and location. In addition, the object’s current state is recorded along with any dependencies between the object and other objects in the application.
If you have a large number of objects in your application, the process can take a considerable amount of time. Consider executing ZOMTouch overnight or at some other convenient time. Once ZOMTouch has finished processing, ZOM has a complete picture of the objects in your application and the interdependencies between these objects.
ZOM, or ZIM Object Management, provides extensive support for managing the objects that make up your applications.
ZOM is a collection of services that assist you in manipulating, analyzing, and maintaining application objects, including programs. These services also support you in managing development projects, migrating applications to new computer systems, and building custom development tools such as program generators.
ZOM services are available as a collection of command line utilities. In this section, examples of ZOM are shown at the command prompt. ZOM Services help developers manipulate and analyze application objects provide a powerful set-oriented method of investigating and managing objects and object dependencies provide a homogeneous view of objects independent of object type provide facilities to co-ordinate development projects and development teams provide high-level services for use in building custom development tools.
ZOM features the following facilities:
support for the creation and destruction of objects and their definitions
object query and analysis
object dependency processing
object import, export, comparison and conversion utilities
keyword indexing of objects.
ZOM also provides a solid foundation for creating custom tools to support your special development needs and to automate repetitive tasks. Code generation, version control, application deployment, application porting, and other tasks can be automated using ZOM.
You can rename an object using the ZOMReName command. The new object name is specified using the target indicator “>”. The following example renames “Customers” to “Custs”.
Deleting an object can be accomplished by using the ZOMDelete command. The following example deletes the object “Customers”, causing its description to be removed from the Object Dictionary:
You can copy an object using the ZOMCopy command. ZOMCopy is similar to ZOMReName, with the target referring to the new object name. The following example copies “Customers” to “TestCusts”.
You can move an object from one directory to another using the ZOMMove command. A set of objects can be moved at once. The destination directory is specified using the target indicator “>”. The following example moves all objects named “Customers” (from the directories to which each belongs) to the directory NewDir:
ZOM also provides a service, ZOMReCreate, for re-creating objects whose definition has changed. Recreating the object Employees would be executed as follows:
ZOMReCreate Employees
A common situation is dealing with “out-of-date” or “corrupt” objects. An object is considered corrupt if it depends on objects which have been erased or moved. Corrupt object must be recreated. You can recreate all corrupt objects using ZOMReCreate, as shown in the following example: