| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 6)

Using Public and Private Naming Conventions

G2 does not distinguish between public and private classes and attributes. Even with the use of item configurations and proprietary restrictions, information hiding in G2 is not perfect, particularly since G2 never restricts programmatic access.

To facilitate encapsulation of public and private knowledge within a module, we recommend that you use the following naming conventions:

For example, here are two items that the G2 Menu System (GMS) module defines:

For more information, see the references in this table:

For information on... See...
Configurations and user modes
Using Configurations and User Modes to Enforce Encapsulation
Proprietary restrictions
Protecting Your KB

Benefits of Using Public/Private Naming Conventions

Using public/private naming conventions on all items and attributes has these benefits:

For information on shadowing, see Shadow Public Procedures with Private Procedures.

Cost of Using Public/Private Naming Conventions

You should be aware of the fact that users will still see private attributes and items through Inspect, regardless of the user mode. This means you might have to explain the naming convention to end users, even if you hide all the private items by using item configurations and proprietary restrictions.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 6)

Copyright © 1997 Gensym Corporation, Inc.