| Prev | Next | Previous Chapter | End of Chapter | Contents | Glossary | Index | Comments | (1 out of 8)

Chapter 5

Representing Values and Types


Describes how to represent values and types by using typed attributes, variables and parameters, lists and arrays, nested data structures, and external data.

Introduction
Summary of Representing Values and Types
Using Attributes to Represent Value Types
Hierarchy of Data Types
Using Indexed Attributes
Guidelines for Declaring Typed Attributes
Use Strong Typing
Avoid Declaring Attributes with the Item-or-value Data Type
Enumerate Symbolic Values
Use Truth Values for Two Alternative Symbolic Values
Use Indexed Attributes to Access Objects Based on Attribute Value
Always Declare an Attribute for Setpoints, Limits, and Constants
Using Variables and Parameters to Represent Historical Data
Variable and Parameter Class Hierarchy
Creating a Subclass of Variable or Parameter
Declaring an Attribute that Contains a Variable or Parameter
Comparison Between Typed Attributes, Parameters, and Variables
Guidelines for Using Typed Attributes, Parameters, and Variables
Use Typed Attributes Whenever Possible
Use Parameters for Simple Histories
Use Variables for More Complex Histories
Choose the Most Efficient Data Structure
Choose the Most Restrictive Data Type
Try to Avoid Time-Based History Specifications
Using Lists and Arrays to Represent Data Series
List and Array Class Hierarchy
Creating a Subclass of List or Array
Declaring an Attribute that Contains a List or Array
Comparison Between Lists and Arrays
Guidelines for Using Lists
Use Lists for Fast Insertion and Removal
Choose the Most Restrictive Data Type
Guidelines for Using Arrays
Use Arrays for Fast Access to Elements by Index
Always Change Array Elements, Never Conclude
Beware of Manipulating Array Elements
Choose the Most Restrictive Data Type
Use Stability Declarations for Value Array Subclasses
Use Native Arrays in Performance-Sensitive Code
Use Casting When Binding Array Subclasses to Local Variables
Using Structures and Sequences to Represent Composite Data
Accessing System-Defined Attributes
Comparison Between Structures and Items
Comparison Between Sequences and Lists
Guidelines for Creating Composite Data Structures
Use Structures to Create Items with Dynamic, Nested Attribute Values
Use Sequences to Create Nested Lists
Using Structures to Represent Attribute-Value Pairs
Creating and Accessing a Structure
Accessing Values of a Structure
Using Sequences to Represent Nested Data Structures
Creating and Accessing a Sequence
Accessing Values of a Sequence
Using Variables to Represent External or Simulated Data
Creating Variables that Obtain Values from External Data Sources
Creating an External Variable
Specifying the Data Server
Specifying the Expiration Time
Specifying the Default Update Interval
Using Variables to Represent External or Simulated Data
Creating Variables that Obtain Values from Formulas
Creating Generic Formulas
Creating Specific Formulas
Causing Variables to Seek Data
Guidelines for Using Variables
Limit Data Seeking
Make Validity Intervals as Long as Possible
Do Not Embed External Variables in Subobjects
Setting the Priority of Data Service
| Prev | Next | Previous Chapter | End of Chapter | Contents | Glossary | Index | Comments | (1 out of 8)

Copyright © 1997 Gensym Corporation, Inc.