Glossary of terms used in the CSO Gateway documentation and in source code comments
Client side terms | Server side terms | In the CSO Gateway
Client side terms
- cso-class, cso-enum, cso-interface
A cso-type that was registered with one of the following method: (Type.registerClass, Type.registerInterface and Type.registerEnum), is called, respectively, a cso-class, a cso-interface and a cso-enum.
- cso-generated class, cso-generated enum, cso-generated interface
The Type Morpher of the CSO Gateway is used to create cso-generated types from classes, structs, interfaces and enums. The Type Morpher will convert classes and structs into cso-classes, these cso-classes are called cso-generated classes. It will convert interfaces into cso-interfaces, these cso-interfaces are called cso-generated interfaces. And it will convert C# enums into cso-enums, these cso-enums are called cso-generated enums.
- cso-generated object
An instance of a cso-generated type.
- cso-generated type
A cso-generated type is a cso-type whose type-defining-script was dynamically generated from a type loaded in the .NET CLR. The type can be a user-defined type or even a type from the .NET framework.
- cso-native class, cso-native enum, cso-native interface
Cso-classes, cso-interfaces and cso-enums that are predefined in the CSO Gateway are called, respectively, cso-native class, cso-native interface and cso-native enum.
- cso-native object
A cso-native object is an instance of a cso-native type.
- cso-native type
A cso-native type is a cso-type predefined in the CSO Gateway. See the CSO Gateway API Documentation - Client side topic.
Cso-types registered with the registerClass, registerInterface and registerEnum methods are called, respectively, cso-class, cso-interface and cso-enum.
In terms of how they are created by the CSO Gateway, cso-types can be split into 2 categories: cso-native types and cso-generated types.
The Object.getType and the Object.getTypeName are, for the most part, returning the correct type and type name for a given value. One exception would be for enums, the Number constructor is returned instead of the (empty) constructor defined for the enum.
The term type usually refers to a type in the .NET CLR.
Server side terms
- cso-compatible object
An object is said to be cso-compatible if all the objects that will be encountered by the Object Gateway while recursively converting the object are instances of cso-compatible types.
An object being an instance of a cso-compatible type does not imply that the it is a cso-compatible object. There are 2 reasons for that:
- A cso-native type may have a generic server-side equivalent (Example: CsoGateway.Collection.List`1 and System.Collections.Generic..::.List<(Of <(T>)>)) and the specified actual type parameters of the constructed generic type may not be cso-compatible.
- Because of polymorphism and the fact that derived classes of cso-compatible class are not automatically cso-compatible, a property might return an instance of a non-cso-compatible type althought the return type of the property -is- cso-compatible.
- cso-compatible type
A type is said to be cso-compatible if one of the following is true:
- The type is from the .NET Framework and can be handled by the CSO Gateway. This includes all primitive types (Int32, Boolean, ...), a number of commonly used structures (DateTime, Decimal, ...), and all types for which there is a corresponding cso-native type in the Native Type Library (List`1, Dictionary`2). A complete list of these types is available in the Reference section.
- It is a cso-generated type.
This status is not inherited. Derived classes of cso-compatible class are not automatically cso-compatible.
- cso-ready type
A type is said to be cso-ready if all the conditions necessary for the Type Morpher to create a corresponding cso-generated type are met. For example, for a -class- these conditions includes
- Being decorated with the CsoGeneratedTypeAttribute
- Having all public properties with a get accessor being of a cso-ready or cso-compatible type
- Have a cso-ready base class -or- a base class not decorated at all with the CsoGeneratedTypeAttribute
After the Type Morpher has created the cso-generated type successfully, the type is no longer said to be cso-ready, it is said to be cso-compatible.
In the CSO Gateway
- CSO Gateway
The term Importer refers to a group of functionnalities inside the CSO Gateway:
- The DependencyGraph class that gathers references to script elements to import on the client and dependencies between them.
- The Importer web control, that renders a list of HTML script tags that imports on the client all the necessary scripts (most of them being type-defining-scripts imported through the ImporterHttpHandler).
The Loader refers to the part of the CSO Gateway that manages the in-memory loading of the cso-native types contained in the Native Type Library, the lazy creation of the cso-generated types (using the Type Morpher). It maintains the mapping between types and their equivalent cso-types. It also takes care of making the creation of the cso-generated types thread safe.
- Native Type Library
The Native Type Library refers to a group of files embedded in the CSO Gateway dll. These files contain the definition of many cso-native types as well as many utility functions. All cso-native types have CsoGateway as their top namespace. Most of them are concerned with collections and are in the CsoGateway.Collections namespace. They are equivalent cso-types for many types found in the System.Collections, System.Collections.Generic and System.Collections.Specialized, namespaces. See the CSO Gateway API Documentation - Client side topic.
- Object Gateway
The term Object Gateway refers to a group of functionnalities inside the CSO Gateway:
- The ObjectGateway web control that takes a cso-compatible object in input, sends it to the ToClientSideMainConverter class and puts the value-creation-script for the cso-object on the page.
- The ToClientSideMainConverter class that provides conversion for primitive types and the recusive aspects of object conversion.
- The others converters (implementing the IToClientSideConverter interface) used to convert cso-native type in the Native Type Libray and also custom converters.