Early Draft K. MacLeod ldo-types The Casbah Project October 1999 Type Naming and LDO Data Types Abstract This document specifies a format for type names used to declare the data types of marshalled data. It also specifies a basic set of data types for use with LDO protocols, as well as formats for declaring object type names in Java, Perl, and Python. 1. Introduction [This document is a very early draft, expect some rather major changes as discussion ensues.] This format is being developed as part of Scarab[4], a framework for handling data and distributed computing. Scarab itself is being developed as part of Casbah[5], a language independent environment for writing applications that access a wide variety of data sources. Scarab supports using data type names other than the ones described here, such as CORBA, DCOM, Java RMI, or language-specific data types. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119[3]. Within this draft, text enclosed within brackets (`[text]') represents issues or incomplete specifications. 1.1 Examples of data type names ldo:number mime:TYPE/SUBTYPE python:MODULE/CLASS perl:PACKAGE java:FULLY.QUALIFIED.CLASS.NAME 2. Type name syntax The type name format is patterned after Universal Resource Identifiers (URIs) in RFC 1630[2]. A complete type name consists of a naming scheme specifier followed by a string whose format is a function of the naming scheme. A BNF description of the type name syntax is given in an a later section. The components are as follows. MacLeod [Page 1] LDO-Types October 1999 SCHEME Within the type name, the first element is the name of the scheme, separated from the rest of the type name by a colon. LOCAL-PART The rest of the type name follows the colon in a format depending on the scheme. The local part is interpreted in a manner dependent on the scheme being used. [do we need to support URL escaping? I.e. %2E.] 3. Specific Schemes The mapping for type names onto some existing standard and experimental type schemes is outlined in the BNF syntax definition. Notes on particular naming schemes follows. The schemes covered are: ldo Basic data types used in LDO protocols mime MIME types (RFC [XXX]) java Java fully qualified class names perl Perl package names python Python module and class names The schemes for Java, Perl, and Python only describe the naming scheme for serialized object instances, not primitive data types. Naming for primitive data types in particular languages are described in other specifications. 3.1 LDO The LDO scheme specifies basic or primitive data types used in LDO protocols. [more detail] 3.2 MIME The MIME scheme specifies how MIME types can be used as type identifiers in LDO protocols. [more detail] 3.3 Java The Java scheme specifies how Java class names are marshalled. [more detail] 3.4 Perl The Perl scheme specifies how Perl package names are marshalled. MacLeod [Page 2] LDO-Types October 1999 [more detail] 3.5 Python The Python scheme specifies how Python module and class names are marshalled. [more detail] 4. Registration of naming schemes [possible text from RFC 1630, which describes an IANA-type formal registration as well as `x-'.] [another alternative would be to take an XML-namespaces approach, where the scheme identifer is an alias for a URI. This would require some form of prior declaration of a namespace, possibly in the not-yet-specified protocol negotiation phase.] 5. BNF of Type Name Syntax [generic type name syntax] 5.1 BNF for specific type name schemes [LDO, MIME, Java, Perl, Python] 6. Conformance and Interoperability [need to fill out this section] 7. Security Considerations This data representation does not contain any features for initiating actions. Type names are not limited in size. Conforming implementations SHOULD perform sanity checks on data received to avoid buffer overruns and out of resource (memory, disk, etc.) conditions. Care SHOULD be taken when instantiating objects. Senders could pass type names that may be used to instantiate objects that could be used to bypass security restrictions. [wording, examples?] References [1] Borenstein, N. and N. Freed, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies", BCP 14, RFC 2119, MacLeod [Page 3] LDO-Types October 1999 September 1993. [2] Berners-Lee, T., "Universal Resource Identifiers in WWW", RFC 1630, June 1994. [3] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [4] http://casbah.org/Scarab/ [5] http://casbah.org/ Author's Address Ken MacLeod The Casbah Project 1330 66th Street Des Moines, IA 50311 US Phone: +1 515 279 0319 EMail: ken@bitsko.slc.ut.us URI: http://casbah.org/Scarab/ MacLeod [Page 4]