Contents
Preface
- About This Guide
- Disclaimer
- Version Information
- Audience
- Organization
- Conventions
- Typographic
- Instructions
- Guidelines and Important Suggestions
- Related Documentation
Part I Planning
Chapter 1 Introduction
- Introduction
- G2 Environment
- G2 Application Server
- G2 Telewindows Client
- G2 Utilities
- G2 Bridge Products
- Developing a G2 Application
- Planning Your Application
- Software Development Practices and Techniques
- Implementing Your Application
- Modularizing Your Application
- Representing Objects and Relationships
- Representing Values and Types
- Processing Data
- Coding Conventions
- Communicating with External Systems
- Building a User Interface
- Maximizing Performance
- Minimizing Memory Use
- Deploying Your Application
- Testing Your Application
- Preparing for Release
- Distributing Your Application
Chapter 2 Software Development Practices and Techniques
- Introduction
- Using Traditional Design Techniques
- Using Operational Prototyping Techniques
- Using Participatory Design
- Using Rapid Prototyping
- Using Goal-Based Design
- Developing a Requirements Specification
- Decomposing the Problem
- Identifying Mission-Critical Applications
- Identifying Real-World Data and Constraints
- Refining the Requirements
- Examples of Successful G2 Applications
- Working in a Team Development Environment
- Using a Single G2 for Sequential Development
- Using Telewindows for Concurrent Development
- Using a Master KB for Parallel Development
- Managing Source Code
- Commercial Source Code Control System Features
- Using SCC Systems with G2
- Essential Features of G2 Source Code Control
- Using G2 Facilities for Source Code Control
- Other Techniques for Source Code Control
- Adhering to Software Development Standards
- Object-Oriented Design
- Modularity
- Reusability
- Scalability
- Naming and Coding Conventions
- Application Programmer's Interface
- User Interface Standards
Part II Implementation
Chapter 3 Modularizing Your Application
- Introduction
- Benefits of Creating Modular Applications
- Supports Parallel Development
- Allows Separation of the GUI from the Core
- Supports Encapsulation
- Encourages Code Reuse
- Provides Self-Documentation
- Supports Testing
- Supports the Use of Standard G2 Utilities
- Selecting a Suitable Module Scope
- Choosing How to Organize Your Modules
- Functional Modules
- Structural Modules
- Limiting the Scope of Modules
- Limiting Module Dependencies
- The Rules of Modularity
- Guidelines for Creating Modularized Applications
- Restrict Inter-Module References to Lower-Level Modules
- Load Each Module as a Top-Level Module to Verify Modularity
- Do Not Hide Violations of Modularity
- Always Save Your Application as Modules
- Designing Reusable Modules
- Separating the Module into Layers
- The Four-Layer Architecture
- Benefits of the Separating the Module into Layers
- Separating the GUI from the Core
- The Four-Layer Two-Module Architecture
- Benefits of Separating the GUI from the Core
- Creating the API
- Creating the GUI
- Encapsulating Your Module
- Determining How Your Application Uses the Data
- Using Data in an End User Interface
- Using Data Internally
- Determining When to Make an Item Private
- Defining Private Knowledge for Public Classes
- Using Configurations and User Modes to Enforce Encapsulation
- Avoiding User Mode Conflicts in Modules
- Using Proprietary Restrictions
- Guidelines for Encapsulating Modules
- Use Public and Private Naming Conventions
- Avoid Cross-Module References to Private Attributes and Items
- Assume Public Classes are Subclassable
- Assume Attributes Inherited across Modules to be Public
- Limit the Scope of Rules and User Menu Choices to the Module that Defines Them
- Organizing Workspaces within Modules
- Guidelines for Organizing Items on Workspaces
- Organize Workspaces According to the Needs of the Application
- Keep Methods Together with Their Class Definition
- Separate Public and Private Items
- Presenting Workspaces Visually
- Creating a Workspace Hierarchy
- Providing Navigation Between Workspaces
- Managing Multi-Module Applications
- Module Initialization
- Version Control
- Module Settings
- Communications and Error Handling
- Message Localization
- Palette Management
- Text Parsing and Other Utilities
- Using the Standard Utilities
- G2 Foundation Resources (GFR)
- G2 User Interface Development Environment/User Interface Library (GUIDE/UIL)
- G2 Menu System (GMS)
- G2 Dynamic Displays (GDD)
- G2 Developer's Interface (GDI)
- G2 XL Spreadsheet (GXL)
- G2 OnLine Documentation (GOLD)
Chapter 4 Representing Objects and Relationships
- Introduction
- Summary of Representing Objects and Relationships
- Using Object-Oriented Techniques for Representing Objects and Relationships
- Objects and Encapsulation
- Classes and Instances
- Inheritance
- Subsystems
- Information Hiding
- Representing Classes and Instances
- Creating a Class Definition
- Displaying the G2 Class Hierarchy
- Creating Instances of a Class
- Guidelines for Creating User-Defined Classes
- Subclass Built-in Data Structures
- Subclass User-Defined Classes
- Subclass Built-in Definition Classes
- Hide Private and Non-Instantiable Classes
- Use Message as the Superior Class for Non-Iconic Classes
- Representing Subclasses and Class Hierarchies
- Creating Subclasses
- Using Multiple Inheritance
- Using Multiple Inheritance
- Linearizing the Class Hierarchy
- Effects of Multiple Inheritance
- Rules of Multiple Inheritance
- Overriding Inherited Characteristics and Behaviors
- Overriding Inherited Attributes
- Overriding Inherited Methods
- Overriding Inherited Icons
- Guidelines for Creating Class Hierarchies
- Normalize the Class Hierarchy
- Create Abstract Classes
- Use Generalization and Differentiation
- Representing Compound Objects and Workspace Hierarchies
- Creating Subobjects
- Guidelines for Creating Subobjects
- Restrict the Class of Subobjects
- Use Subobjects When an Object Contains but Does Not Define Another Object
- Do Not Embed External Variables in Subobjects
- Creating Subworkspaces
- Guidelines for Creating Subworkspaces
- Create Hierarchical Views to Hide Information
- Create Subworkspaces to Store Adjunct Information
- Use Activatable Subworkspaces to Control Which Parts of Your Application are Active
- Creating Workspace Hierarchies
- Guidelines for Creating Workspace Hierarchies
- Create Only One or Two Workspace Hierarchies
- Name as Few Workspaces as Possible
- Do Not Create a Large Number of Subworkspaces
- Identify the Top-Level Workspace
- Consider Creating a Top-Level Palette
- Representing Physical and Conceptual Relationships
- Examples of Connections
- Examples of Relations
- Using Connections to Represent Graphical Relationships
- Creating and Deleting Connections
- Defining a Connection Class
- Declaring Connection Stubs for a Class
- Creating and Deleting Connections Between Objects
- Using Relations to Represent Non-Graphical Relationships
- Creating and Deleting Relations
- Creating a Relation Definition
- Concluding and Breaking Relations Between Items
- Detecting Connection and Relation Events
- Comparison Between Connections and Relations
- Guidelines for Using Connections and Relations
- Use Connections to Create Graphical Relationships
- Use Connections to Provide Configurability
- Use Connections to Provide Information about Relationships
- Use Relations to Create Non-Graphical Relationships
- Use Relations to Control the Number of Related Items
Chapter 5 Representing Values and Types
- 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
- 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
Chapter 6 Processing Data
- Introduction
- Terminology
- Determining Which Type of Processing to Use
- Choosing Between Rules and Procedures
- Similarities Between Rules and Procedures
- Differences Between Rules and Procedures
- Syntactic Differences Between Rules and Procedures
- Emphasizing Procedural Processing
- Using Rule-Based Processing
- Using "Whenever" Rules to Detect Events
- The Five Types of "Whenever" Rule Events
- Example of Event Detection
- Using "If" Rules for Data-Driven Processing
- Example of Data-Driven Processing
- Summary of Forward Chaining Options for Parameters and Variables
- Summary of When Attributes, Parameters, and Variables Forward Chain
- Using Backward Chaining
- Detecting When the Value of a Variable Changes
- When Different Types of Rules Initiate New Processes
- Guidelines for Implementing Rule-Based Processing
- Emphasize "Whenever" Rules Over "If" Rules
- Encapsulate the Consequent of a "Whenever" Rule
- Avoid Scanning Rules
- Write Rules that are as Generic as Possible
- Do Not Use "Initially" Rules
- Use "Unconditionally" Rules with Caution
- Minimize Backward Chaining
- Narrow the Scope of Rules to Minimize Rule Invocations
- Disable Rule Highlighting
- Using Procedural Processing
- Choosing Between Methods and Procedures
- Using Methods to Describe Object Behaviors
- Creating a Method
- Creating a Method Hierarchy
- Documenting the Calling Protocol for a Method
- Using Procedures for Generic Sequential Processing
- Creating Test Procedures
- Creating Callback Procedures
- Creating Non-Extensible Procedures that Operate on Values
- Creating API Procedures
- Initiating Procedural Processing
- Implementing Single-Threaded Procedural Processing
- Maintaining Atomicity
- Implementing Multi-Threaded Procedural Processing and Wait States
- Wait States
- Procedural Statements that Implement Multi-Threaded Processing and/or Introduce Wait States
- Examples of When to Use Multi-Threaded Processing and Wait States
- Guidelines for Implementing Procedural Processing
- Keep Procedures to a Manageable Length
- Eliminate Redundant Code
- Use Specific Type Declarations
- Avoid Polling
- Do Not Redefine the Role of Local Variables
- Clean Up Unused Local Variable Declarations
- Signal Errors, Do Not Return Status Flags
- Use Methods to Implement Optional Procedure Arguments
- Maintain Atomicity Whenever Possible
- Consider Performance
- Write Code So Few Comments are Necessary
- Constructing an API
- Determining the Scope of the API
- Validating Arguments and Signalling Errors
- Guidelines for Creating an API
- Include the Client as an Argument
- Maintain Atomicity in API Procedures
- Shadow Public Procedures with Private Procedures
- Limit the Use of On Error Statements
Chapter 7 Coding Conventions
- Introduction
- Using Module Prefixes
- Benefits of Using Module Prefixes
- Costs of Using Module Prefixes
- Using Public and Private Naming Conventions
- Benefits of Using Public/Private Naming Conventions
- Cost of Using Public/Private Naming Conventions
- Using Naming Conventions for Items and Attributes
- Using Coding Conventions for Methods, Procedures, and Rules
- Naming Conventions
- Indentation Conventions for Methods and Procedures
- "Begin" Statement
- "Repeat" and "For...Do" Statements
- "If-Then-Else" Statement
- "Case" Statement
- "On error" Statement
- "Collect data" Statement
- Examples of Properly Indented Procedures
- Indentation Conventions for Rules
- Examples of Properly Indented Rules
Chapter 8 Communicating with External Systems
- Introduction
- Communicating with Databases
- Communicating with Devices and Data Historians
- Available Device Bridges
- Available Data Historians
- Communicating with Networking Standards and Protocols
- Using Distributed Object Standards
- Using CORBA
- G2-CORBALink
- CORBA Clients
- CORBA Servers
- Object Loaders
- CORBA Common Object Services
- CORBA Name Service for Large Applications
- Using Microsoft COM
- G2-ActiveXLink
- Using Java
- G2 Gateway/Java
- Using TCP/IP
- G2-SocketManager
- Using HTTP
- G2 WebLink
- G2 WebMiner
- Communicating with Middleware
- G2-@aGlance Bridge
- Using Third-Party Bridges
- Developing Custom Bridges
- G2 Gateway
- G2 Gateway/Java
Chapter 9 Building a User Interface
- Introduction
- History of GUI-Building Tools at Gensym
- Developing a User Interface that is Separate from the Core
- Using G2 End User Displays and Components
- Using the G2 Icon Library
- Using Configurations and User Modes
- Using GFR to Support User Interface Development
- Communications and Error Handling
- Localization
- Palette Management
- Using GUIDE/UIL to Create Dialogs
- Using a GUIDE User Interface
- Creating a GUIDE User Interface
- Viewing and Editing Attribute Values through Dialogs
- Representing Different Types of Data
- Configuring GUIDE Programmatically
- Customizing UIL Controls
- Using UIL Methods, Actions, and Callbacks
- Distributing Your GUIDE Application
- Using GMS to Create Menus
- GMS Menu Types
- Pulldown Menus in Menu Bars
- Popup Menus
- Cascade Menus
- GMS Menu Entries
- Types of Menu Entries
- Enabled and Disabled Menu Entries
- Associating Help with a Menu Entry
- Defining GMS Menus Statically or Dynamically
- Customizing GMS Menus Globally or for Each User
- Using GDD to Create Dynamic Icons
- Localizing a Dynamic Display
- Using GDI to Create an Interface
- Related G2 Utilities
- Using GXL to Create Tabular Displays
- GXL Specifications
- The GXL Spreadsheet
- Spreadsheet Cells
- Cell Data Types
- The GXL Spreadsheet View
- GXL and Conventional Spreadsheets
- Using GXL to Edit G2 Lists and Arrays
- Application Programmer's Interface
- Using GOLD to Access Online Documentation
- The Online Documentation
- Gold Books
- URLs
- How GOLD Uses URLs
- Context-Sensitive Help
- Keyword Searches
- Application Programmer's Interface to GOLDUI
Chapter 10 Maximizing Performance
- Introduction
- How to Measure Performance
- Guidelines for Maximizing Performance
- Declarations
- Make Type Declarations as Specific as Possible
- Use Local Variable Assignment Statements Wisely
- Use Stability Declarations
- Data Representation
- Use Arrays for Fast Direct Access and Data Storage
- Use List for Fast Manipulation of Elements
- Use Indexed Attributes when Referencing by Attribute Value
- Use Variables Only When Necessary
- Try to Avoid Time-Based History Specifications
- Do Not Transfer to Workspace Unless Necessary
- Procedural Processing
- Use Inlining for Procedure Calls
- Minimize "On Error" Statements
- Use "Do in Parallel" to Interact with External Processes
- Minimize Thread Interruption
- Use System Procedures
- Use Procedures Over Methods for Performance-Sensitive Code
- Knowledge Bases
- Consider Issues of Scalability
- Separate Animation from Performance-Sensitive Code
- Hide Tables and Attribute Displays
- Minimize the Use of Displays
- Avoid Scanned Rules and Polling Procedures
- Disable Rule Highlighting
- Use Scheduled Drawing
- Statements
- Minimize Conclude Statements
- Avoid "Change the Text of" Expressions
- Avoid Existence and Type Checking
- Beware of Statements that Cause Implicit Iteration
- Be Careful with List Iterations
- Use Referencing Based on Relations in Performance-Sensitive Code
- Test Symbolic Equality with "=" Not "is"
Chapter 11 Minimizing Memory Use
- Introduction
- Guidelines for Minimizing Memory Use
- Select Memory-Efficient Data Structures
- Hide Name Boxes and Attribute Displays
- Minimizing Non-Functional Items
- Preventing Memory Leaks
- Pair Create and Delete Statements within the Same Procedure
- Avoid Generating Random Names
- Detecting and Preventing Memory Overload
Part III Deployment
Chapter 12 Testing Your Application
- Introduction
- Designing Applications that Support Testing
- Guidelines for Testability
- Use Modularity to Constrain Testing Scope
- Build Upon Proven Modules Where Possible
- Always Develop Written Specifications
- Make All Interfaces Programmatically Accessible
- Constrain Concurrency and Asynchronicity
- Use Strong Typing
- Design Error Handling Reliably
- Establish and Follow Coding Standards and Guidelines
- Guidelines for Writing Self-Documenting Code
- Always Use Accurate and Descriptive Names
- Use the Public-Private Naming Convention
- Make Type Declarations as Precise as Possible
- Organize Your Module
- Include Well-Selected Comments
- Testing Incrementally During the Implementation Phase
- Developing Test Suites During the Deployment Phase
- Testing for Regressions During Software Upgrades
Chapter 13 Releasing Applications
- Introduction
- Preparing the Directory Structure
- Source Code
- Release Code
- Preparing an Application for Release
- Adding Version Information
- Protecting Your KB
- Adding Proprietary Packages to Workspaces
- Adding User Interface Configurations
- Adding Text Stripping Marks to Your KB
- Creating a Release Manager Module
- Carrying out the Release Process
Chapter 14 Distributing Your Application
- Introduction
- Distributing G2 to Telewindows Clients
- Connecting Your Telewindows to a Running G2
- Displaying the Same KB in Different Windows
- Displaying the Same Workspace in Different Windows
- Distributing G2 on the World Wide Web
- Using G2 WebLink and G2 WebMiner
- Using Telewindows Plugins
- Distributing G2 on Native Clients
Part IV Appendix, Glossary, and Index
Appendix A Benchmarking Results
- Comparing G2 Operations
- Example of Comparing Operations: Change Versus Conclude
- Comparison of Various Types of Value Assignments
- Comparison of Various Types of References
- Effect of Subclassing, Stability, and Casting on List and Array Value Assignments
- Effect of Subclassing, Stability, and Casting on Array References
- Effect of Tight Typing versus Loose Typing
- Effect of Stability Declarations on Tight versus Loose Typing
- Comparison of Different Types of Global References
- Comparing Method, Procedure, and Function Calls
- Effect of Using System Procedures
- Effects of Attributes Displays and Tables
- Effect of On Error Statements
- Effect of Testing for Symbolic Equality
Glossary
Index
Copyright © 1997 Gensym Corporation, Inc.