Encapsulation could be considered a natural fall out of the functional programing style. Though what you are encapsulating is extremely limited to a method with local scope variables via Module.
To my eye, inheritance doesn't make sense without classes.
As far as rigid class structure, it appears it is not here, per se. Roman's book was written for Mathematica 4. Maybe Mathematica 8 has new additions...
My conclusion is Mathematica is a modern functional programming language. It is not a modern object oriented programming language. Many people here resort to Java for their object oriented needs as Java integrates very well with Mathematica.
To be fair, IDE environments like VisualStudio C# set object oriented programming bar so high that all other object oriented environments will be laborious by comparison. Just my opinion.
Having said all of this, there is a definite gap between Mathematica notebook scripting and Mathematica large program development. Fortunately the scripting is powerful enough to get me through most tasks.
Paul McHale | Electrical Engineer, Energetics Systems | Excelitas Technologies Corp.
Please consider the environment before printing this e-mail. This email message and any attachments are confidential and proprietary to Excelitas Technologies Corp. If you are not the intended recipient of this message, please inform the sender by replying to this email or sending a message to the sender and destroy the message and any attachments. Thank you
-----Original Message----- From: Ralph Dratman [mailto:email@example.com] Sent: Saturday, April 07, 2012 5:58 AM Subject: Re: fyi, small note on using Mathematica for object
Please explain how you mean this. It is not a technique I have been able to find in the Virtual Book or other documentation.
What corresponds to a class, and how does one use a class to create one or more object instances? How does one run a method from an object?
A brief example would be most helpful.
On Fri, Apr 6, 2012 at 5:58 AM, DrMajorBob <firstname.lastname@example.org> wrote: > Mathematica is already object-oriented WITHOUT all that. What a lot of > overhead for nothing. > > Bobby > > On Thu, 05 Apr 2012 04:49:54 -0500, Nasser M. Abbasi <email@example.com> wrote: > >> >> Just FYI, >> >> I wrote this small note on using Mathematica for object-based >> programming. I found that it works really well for me. >> >> Nothing too advanced, just a simple way of using Module but in a >> way to emulate object based programming that I did not know about >> before. >> >> http://12000.org/my_notes/object_based_in_mathematica/v1.html >> >> --Nasser >> > > > -- > DrMajorBob@yahoo.com >