Type Definitions
- All Type Definitions must have a #type defined (string) and if assigned to a global variable, the global variable should be the same name as the type name.
- Example: “TAG_typ_NameOfType”
- format is typically : TAG_ADDON_typ_NAME (see the XPS Nomenclature Guide for more info)
- Private members are in Camel Case with a leading underscore
- Example: “_nameOfThing”
- Private members are still accessible as ‘Public’ but by utilizing a unique identifier at runtime, can prevent accidental or intentional use from outside the hashmap object ‘class’ - whether inherited or external
- Protected members are in Camel Case
- Example: “myMethod”
- Protected members are not really “protected” - they are also ‘Public’ but, the understanding is : if it’s Camal Case, do not use it outside of the type and only through inheritance. A visual cue only.
- Public mebers are in Pascal Case
- Example: “MyOtherMethod”
- All members are technically ‘publlic’ but, use of Pascal Case implies it is intended to be used anywhere outside of the type itself.
- Always define #str. It should by default return the #type in string format if not set to return something else.
- Code example for returning #type:
["#str", {_self get "#type" select 0}]
- Exceptions, for example, will return it’s data in formatted text instead of the type name
- If not defined,
str myHashmapObject
for example, will return the source code in string format and thus should be avoided for performance and debugging reasons
Interfaces
- All interfaces assigned to a global variable are to follow the same standard as a type definition with the exception that typ is replaceed with ifc
- All members have a key (string) and a value “string” at a minimum
- All members should equate to a Public member of a type that implements the interface - do not define Private or Protected members
- If there is a third element of the member array, it is to be used for Attributes only. See Interfaces for more info about Attributes.