octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Musings about the chapter "OO-programming" in the docs


From: Ben Abbott
Subject: Re: Musings about the chapter "OO-programming" in the docs
Date: Fri, 01 Apr 2011 08:05:45 -0400

On Apr 1, 2011, at 7:22 AM, Alexander Klein wrote:

> Hello list,
> 
> I'm just starting to transform a homegrown library of procedural code to 
> OO-octave, and while reading the respective chapter in the docs, I was really 
> baffled about the complexity of some of the methods shown in the examples.
> 
> The text states that a class should define getters and setters, which is 
> quite a good thing from an OO-point of view, but then goes on to define get 
> and set methods for the example polynomial class that are superficially OO, 
> but almost completely procedural under the hood. Set even goes so far as to 
> process variable argument lists.
> 
> Maybe I'm missing something, but given the complexity of the conditional 
> blocks for error trapping and all the slow string compares that happen in set 
> - and in get as well - wouldn't it be much better to refactor the whole 
> example to match common OO-design rules from languages like Smalltalk or Java?


The current OO implementation is compatible with the Matlab's old approach.  
Matlab's new syntax has not yet been implemented. The document below gives a 
reasonable description of Matlab's syntax for both.

        http://www.advancedmcode.org/object-oriented-programming-in-matlab.html

Does the new syntax meet your expectations?

I don't think anyone is actively working on this at the moment. However, if 
you, or someone you know, would be interested in working on such a project, 
your efforts would be welcomed and appreciated.

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]