Automated Solutions Group has released ObjectTools 1.5.5 — a 4th Dimension plug-in that provides a set of routines for creating “Objects” — for both the Mac and Windows. Now, rather than using offsets, data is stored into and retrieved from Objects by name.
Objects are entities in which you can store and retrieve data of differing types. According to the folks at ASG, this is similar to what you can do with 4D BLOBs, but with several differences: Rather than using offsets, data is stored into and retrieved from Objects by name. Whereas BLOBs are the equivalent of ROM — once written, you cannot really modify their contents — Objects are more like RAM. Once stored, data in Objects can be modified in place, retrieved into 4D variables, and copied to other Objects. Because Objects are represented by Longint handles, you can create arrays of Objects. The update also fixed a resource conflict with custom users resources.
Objects can be used to reduce the number of process and interprocess variables; to save and restore complex configuration data, such as the configuration of plug-ins; and to allow an object-oriented style of programming.
In classical programming terms, Objects are implemented as an unordered dictionary. A dictionary is a collection of key-value pairs, where the key uniquely identifies a value. In the case of Objects, the key is the item reference, or tag. The value is whatever was stored with the key.
Objects are unordered dictionaries, meaning that the order of the key-value pairs at any given time is the order in which they were added to the Object. Therefore, in theory, the worst-case performance of the key lookup will increase linearly with the number of items in the Object, but in practice you will never notice any performance degradation, according to ASG.
ObjectTools for either the Mac or Windows is US$149.95. An ObjectTools bundle (with both “flavors”) is $199.95.