Using Caché Objects
- About This Book
- Introduction to Caché Objects
- Caché Objects Architecture
- Class Definitions and the Class Dictionary
- The Caché Class Library
- Development Tools
- User Interface Development and Client Connectivity
- Defining and Compiling Classes
- Introduction to Terminology
- Kinds of Classes
- Kinds of Class Members
- Defining a Class: The Basics
- Naming Conventions
- Inheritance
- Introduction to Compiler Keywords
- Creating Class Documentation
- Compiling Classes
- Making Classes Deployed
- Package Options
- Overview of Packages
- Package Names
- Defining Packages
- Package Mapping
- Package Use When Referring to Classes
- Importing Packages
- Defining and Referring to Class Parameters
- Introduction to Class Parameters
- Defining Class Parameters
- Parameter Types and Values
- Referring to Parameters of a Class
- Defining and Calling Methods
- Introduction to Methods
- Defining Methods
- Specifying Method Arguments: Basics
- Indicating How Arguments Are to Be Passed
- Specifying a Variable Number of Arguments
- Returning a Value
- Specifying the Implementation Language
- Types of Methods (CodeMode Options)
- Projecting a Method As an SQL Stored Procedure
- Calling Class Methods
- Casting a Method
- Overriding an Inherited Method
- Working with Registered Objects
- Introduction to Object Classes
- OREF Basics
- Creating New Objects
- Viewing Object Contents
- Introduction to Dot Syntax
- Validating Objects
- Determining an Object Type
- Cloning Objects
- Referring to Properties of an Instance
- Calling Methods of an Instance
- Obtaining the Class Name from an Instance
- $this Variable (Current Instance)
- i%PropertyName (Instance Variables)
- Introduction to Persistent Objects
- Persistent Classes
- Introduction to the Default SQL Projection
- Identifiers for Saved Objects: ID and OID
- Class Members Specific to Persistent Classes
- Other Class Members
- Extents
- Globals
- Working with Persistent Objects
- Saving Objects
- Testing the Existence of Saved Objects
- Opening Saved Objects
- Swizzling
- Reloading an Object from Disk
- Reading Stored Values
- Deleting Saved Objects
- Accessing Object Identifiers
- Object Concurrency Options
- Version Checking (Alternative to Concurrency Argument)
- Defining Persistent Classes
- Defining a Persistent Class
- Projection of Packages to Schemas
- Specifying the Table Name for a Persistent Class
- Storage Definitions and Storage Classes
- Schema Evolution
- Resetting the Storage Definition
- Controlling How IDs Are Generated
- Controlling the SQL Projection of Subclasses
- Redefining a Persistent Class That Has Stored Data
- Defining and Using Literal Properties
- Defining Literal Properties
- Defining an Initial Expression for a Property
- Defining a Property As Required
- Defining a Computed Property
- Defining a Multidimensional Property
- Common Data Type Classes
- Core Property Parameters
- Class-Specific Property Parameters
- Defining Enumerated Properties
- Specifying Values for Literal Properties
- Using Property Methods
- Controlling the SQL Projection of Literal Properties
- Working with Collections
- Introduction to Collections
- Defining Collection Properties
- Adding Items to a List Property
- Adding Items to an Array Property
- Working with List Properties
- Working with Array Properties
- Copying Collection Data
- Controlling the SQL Projection of Collection Properties
- Creating and Using Stand-Alone Collections
- Working with Streams
- Introduction to Stream Classes
- Declaring Stream Properties
- Using the Stream Interface
- Stream Classes for Use with gzip Files
- Projection of Stream Properties to SQL and ODBC
- Defining and Using Object-Valued Properties
- Defining Object-Valued Properties
- Introduction to Serial Objects
- Possible Combinations of Objects
- Specifying the Value of an Object Property
- Saving Changes
- SQL Projection of Object-Valued Properties
- Defining and Using Relationships
- Overview of Relationships
- Defining a Relationship
- Examples
- Connecting Objects
- Removing a Relationship
- Deleting Objects in Relationships
- Working with Relationships
- SQL Projection of Relationships
- Creating Many-to-Many Relationships
- Other Options for Persistent Classes
- Defining a Read-Only Class
- Adding Indices
- Adding Foreign Keys
- Adding Triggers
- Referring to Fields from ObjectScript
- Adding Row-Level Security
- Defining Method and Trigger Generators
- Introduction
- Basics
- How Generators Work
- Values Available to Method Generators
- Values Available to Trigger Generators
- Defining Method Generators
- Generators and INT Code
- Generator Methods and Subclasses
- Defining and Using Class Queries
- Introduction to Class Queries
- Using Class Queries
- Defining Basic Class Queries
- Defining Custom Class Queries
- Defining Parameters for Custom Queries
- Additional Custom Query Example
- When to Use Custom Queries
- SQL Cursors and Class Queries
- Defining and Using XData Blocks
- Defining Class Projections
- Defining Callback Methods
- Callbacks and Triggers
- %OnAddToSaveSet()
- %OnAfterBuildIndices()
- %OnAfterDelete()
- %OnAfterPurgeIndices()
- %OnAfterSave()
- %OnBeforeBuildIndices()
- %OnBeforePurgeIndices()
- %OnBeforeSave()
- %OnClose()
- %OnConstructClone()
- %OnDelete()
- %OnNew()
- %OnOpen()
- %OnReload
- %OnRollBack()
- %OnValidateObject()
- %OnDetermineClass()
- Using and Overriding Property Methods
- Introduction to Property Methods
- Property Accessors for Literal Properties
- Property Accessors for Object-Valued Properties
- Overriding a Property Getter Method
- Overriding a Property Setter Method
- Defining an Object-Valued Property with a Custom Accessor Method
- Defining Data Type Classes
- Overview of Data Type Classes
- Defining a Data Type Class
- Defining Class Methods in Data Type Classes
- Defining Instance Methods in Data Type Classes
- Implementing Dynamic Dispatch
- Introduction to Dynamic Dispatch
- Content of Methods Implementing Dynamic Dispatch
- The Dynamic Dispatch Methods
- Object-Specific ObjectScript Features
- Relative Dot Syntax (..)
- ##Class Syntax
- $this Syntax
- ##super Syntax
- Dynamically Accessing Objects
- i%<PropertyName> Syntax
- ..#<Parameter> Syntax
- Using the Caché Populate Utility
- Data Population Basics
- Default Behavior
- Specifying the POPSPEC Parameter
- Basing One Generated Property on Another
- How %Populate Works
- Custom Populate Actions and the OnPopulate() Method
- Alternative Approach: Creating a Utility Method
- Using the %Dictionary Classes
- Using the Object Synchronization Feature