This difference should be obvious to those with knowledge of database systems. However, in Haystack we extend the concept of database primitive from the usual set of strings, ints, reals, etc. The Haystack data model primitive provides a wrapper around any conceivable data type. For example a needle.Text represents a wrapping around a particular bit of digital text. An needle.Date may wrap around a long representation of the date.
To access this information, NeedleWeavable defines the getData() method. The return type of getData() is of the Java Object class. Therefore it is up to the programmer to cast the Object to a more specific type. So for example, postsciptNeedle.getData() may return a String, or an integer, or some other primitive type. The setData(...) operation of the Needle will also take as argument an Object. However, the Needle programmer may throw a NeedleDataException if the data is not castable to the required format. For example, if the Needle is supposed to hold an integer, and is passed the string: ``foo bar mumble,'' a NeedleDataException is throw.
It is our hope that this flexibility will not cause great difficulties to the programmers and users of our system. By properly specifying the behavior of all nodes we hope that the added functionality will allow for a richer set of services and applications.