Wolfram Library Archive

Courseware Demos MathSource Technical Notes
All Collections Articles Books Conference Proceedings
Title Downloads

Mathematica's Object Orientation

Stephan Leibbrandt
Organization: Symbols and Numbers Mathematische Software GbR

2006 Wolfram Technology Conference
Conference location

Champaign, IL

Why try to implement object orientation in Mathematica? The previously made approaches were rather focused on research and development than on practice. Here we present a standard package for Mathematica that will be commercially available by the time of the conference. It has a syntax similar to Java that is simpler than shown in other approaches. In order to address greater problems than before, the object functions have a reasonable calculation speed of several thousand calls per second. In contrast to the approaches we know about, it covers many more concepts of object orientation and comes with an in-depth documentation, including a userís guide and a reference guide with many examples for every single function. Therefore, it is not only a proof of principle, but addresses the problems of the practitioner. In order to be a real object orientation, the package implements four main paradigms: - abstract data types: combination of object state and behavior - encapsulation: restricted access to class members - inheritance: child reuses parent functionality - polymorphism: use of object context Keywords were choosen as in Java, for example: Class, New, Public, Protected, Private, Static, Abstract, and InstanceOf. Analogous to Java, the access is through the Dot operator without affecting the system or user definitions for Dot. The presentation explains the basic syntax of the package and some aspects of class definition and object creation. Additionally, it shows how the four paradigms mentioned above are implemented in the package. Finally, a simple model editor is shown that is based on the package. The model editor is ready to be demonstrated with interactive graphics of Mathematica Version 6. Then, model elements are placed by drag-and-drop method.

*Wolfram Technology > Programming
Downloads Download Wolfram CDF Player

ObjectOrientationForMathematica.nb (8.5 MB) - Mathematica Notebook [for Mathematica 5.0]