| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (8 out of 8)

Using Structures and Sequences in User-Defined Classes

You can use structures and sequences as user-defined attribute values in class definitions. Unlike the general and specific G2 value types (quantity, integer, float, and so on), both structures and sequences can consist of multiple values:

While structures and sequences offer similar functionality to objects and lists, respectively, they consume considerably less memory. If your class-specific attributes do not require the full capabilities that objects and lists provide, we recommend that you use:

Here are comparisons between structures and items, and sequences and lists.

Comparing Structures and Items

The fundamental properties of structures and items are:

Property Structures Items
Has iconic representation


Has methods.


Has inheritance


Can save as permanent knowledge


Consists of attributes and values


Can conclude values into attributes


Has fixed set of attributes defined by a class definition


Has arbitrary set of attributes that can be added to and removed from per instance


Must be created and deleted explicitly


Requires minimum memory


Memory and existence are managed automatically


Comparing Sequences and Lists

The fundamental properties of sequences and lists are:

Property Sequences Lists
Has iconic representation


Requires minimum memory


Can save elements as permanent KB knowledge


Can have elements of structures and sequences


Programmatically manipulate elements


| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (8 out of 8)

Copyright © 1997 Gensym Corporation, Inc.