"NYIMI Jose (BMB)" wrote:

> I know that in Perl OO the name of a method can be a variable.
> Which end up with code like this:
>
> my $obj= new MyClass;
> #here the thing
> $obj->$method();

ObjectInstanceName.Method(param1, param2,...);

I would not try to extrapolate Perl hacks to any language with true class definition 
capabilities.  It wpould be the equivalent of tinkering with a brand-new Lexus to give 
it the look and feel of a '62 Falcon.

Generally, high-end OO languages will provide features to allow for actual class 
definitions.  In C++, only declarations [function signatures] are required within the 
class for functions.  In Java, any class functions must be fully defined within the 
body of the class definition.  I much prefer the C++ approach, as it provides a 
greater modularity, seperating interface [declarations and function signatures] from 
implementation code.  Implementations can be freely interchangeable, as long as the 
fulfill the interface "contract" contained in the functions signature.

When in Rome ... I don't mean to put down Perl OO.  It obviously works for those who 
use it.  I just think that, if you are going to start doing OO in other, 
better-equipped languages, you should start fresh.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to