Fire up your applications with Jetfire
RSS
Jetfire Wiki


Quick Search
»
Advanced Search »

Empty Object

An empty object is a 'read only' object that is automatically created by Jetfire as required on a per workflow class basis. It is a major component of Jetfire's Void Safety mechanisms.

Assigning Empty

Workflows are automatically assigned to the empty object. For example
MyClass myObject; // is really MyClass myObject = MyClass.Empty();

Testing for Empty

Empty object can be tested using the follow contructs:
if (myObject == MyClass.Empty()) ...
or
if (isEmpty(myObject))...
Note: The method 'isEmpty' will also return true if the parameter is null.

Modifying an Empty Object

A 'Empty' object is a 'read only' object and can not be modified currently in Jetfire code. It can be modified by editing the XML representation of the empty object found in the Server Nexus persistent storage mechanism.

Creating a Custom Empty Object (V1.3.5)

A custom empty object can be created in a class by inserting a empty creation method called 'CreateEmpty()'. If this method is found the parser will execute this method a the end of parsing/code creation process, assigning the return value to the empty object for the class.

Rules for 'CreateEmtpy' method (enforced by parser).
  • Must be static
  • Must have no parameters
  • Must have a return type of container class.
  • The name 'CreateEmpty' is reserved for this functionality.
  • Can not be over loaded.
  • Does not need to be public.
  • An empty object may not have role assigned.
  • Circular empty references are allowed (see the download for an example).
    • A double linked list would be an example of circular reference that is allowed.

@"namespace Test
{
public workflow Color
{
string c;
public string Value
{
get{return c;}
}
// constructor
public Color(string c)
{
this.c = c;
}
// Executes after the static constructor executes.
// The method 'CreateEmpty()' is called automatically at
// the end of parse/compilation process.
public static Color CreateEmpty()
{
// make the empty color 'no color'
Color color = new Color(""no color"");
return color;
}
}
}



See Also

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.