Skip to content
baijioss edited this page Dec 18, 2014 · 2 revisions

Baiji Types

The Baiji type system is intended to allow programmers to use native types as much as possible, no matter what programming language they are working in. The Baiji IDL provides descriptions of the types which are used to generate code for each target language.

Base Types

The base types were selected with the goal of simplicity and clarity rather than abundance, focusing on the key types available in all programming languages.

  • bool: A boolean value (true or false)
  • int: A 32-bit signed integer
  • long: A 64-bit singed integer
  • double: A 64-bit floating point number
  • string: A text string encoded using UTF-8 encoding Note the absence of unsigned integer types. This is due to the fact that there are no native unsigned integer in many programming languages.

Special Types

binary: a sequence of encoded bytes

Class

Baiji classes define a common object -- they are essentially equivalent to classes in OOP language, but without inheritance. A struct has a set of strongly typed fields, each with a unique name identifier. Fields may have required or optional annotation that is described in the Baiji IDL.

Containers

Baiji containers are strongly typed containers that map to commonly used and commonly availiable container types in most programming languages. There are two container types:

  • list: An ordered list of elements. Translates to a Java ArrayList, C# List, etc.
  • map: A map of strictly unique string keys to values. Translates to a Java HashMap, C# Dictionary, etc. list elements or map values may be of any valid Baiji Type. Note the key type of map must be a string.

Services

Services are defined using Baiji types. Definition of a service is semantically equivalent to defining an interface in object oriented programming. The Baiji code generator tool generates fully functional client that implement the interface and server stubs.

A service consists a set of named functions, each with one request type parameter and one return type.

Clone this wiki locally