Wolfram Library Archive

Courseware Demos MathSource Technical Notes
All Collections Articles Books Conference Proceedings

Compilable Object Orientation in Objectica

Stephan Leibbrandt
Organization: Symbols and Numbers Mathematische Software GbR

Wolfram Technology Conference 2012
Conference location

Champaign, Illinois, USA

The package Objectica upgrades the powerful language of Mathematica by an easy to use object orientation. Thereby, real objects have a direct counterpart in Objectica. In the past, some users requested a higher speed for doing larger simulations. Therefore, the compilation of object oriented code was added to Objectica by means of the built in function Compile. According to restrictions of the compiler, a specific notation needs to be chosen. The basis are classes used as templates to generate objects. Classes are defined outside Compile. Each class member may be any number type or a function and is accessed through a simple dot operator notation. Inheritance of classes supports the generalization and the modularization of code. Objects in a list may be of different types. There is no callback to the Mathematica interpreter as long as the expanded object accesses are compilable. In terms of performance, in one second ten thousand objects are generated or a few hundred thousand objects are accessed. Examples in the presentation demonstrate the syntax, the compilation and calculation results. The complete code is shown for all examples. Like all other functionality, Objectica fully integrates the compilable object orientation with examples in the Mathematica help system.

*Wolfram Technology