Chapter 3
Modularizing Your Application
Describes the benefits of modular development, and how to modularize, organize, and encapsulate knowledge to create reusable modules.
- 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)
Copyright © 1997 Gensym Corporation, Inc.