Tim Pushor <[EMAIL PROTECTED]> writes:
>>
>>(Muppet...)
>> however, unless your methods really are class static methods (e.g. 
>> constructors and helpers), don't make them "OO style" just to get the 
>> -> syntax.  

Why not? - that seems a little backwards to me. In my mind
it is "static methods" which may make sense as functions.
But passing class (name) as 1st arg allows inheritance to work.

>> if it's conceptually just a function, it should stay a 
>> function.  

But as has been said already a method _is_ just a function.
Making a class object 1st arg allows either syntax to be used.

The main drawback of the -> syntax is that method lookup is slower
than normal function call.

>> the namespace problem is easily solved by not exporting 
>> your functions (which you really shouldn't do anyway without good 
>> reason):
>>
>Got me here. I really just did want to do it to use the simpler 
>notation. For example, my ISAM stuff lives in
>
>AlphaBasic::Bridge::ISAM
>
>It is just way to error prone and difficult to read/write something like:
>
>if (!AlphaBasic::Bridge::ISAM::open(...,...,...,..) {
>    die "Open failed: ".AlphaBasic::Bridge::ISAM::errf(...);
>}
>
>AlphaBasic::Bridge::ISAM::isam(..,...,...);
>while (AlphaBasic::Bridge::ISAM::err(...)!=38) {
>    @fields=AlphaBasic::Bridge:::ISAM::read(...,...,...);
>    AlphaBasic::Bridge::ISAM::isam(...,...,...);
>}
>
>becuase I am using stuff like open,close,read,write,etc I can't export 
>them. Right now, I am using functions with ab_open, ab_close, ab_errf, 
>but don't; really like that either.

In this case OO style sounds fine.

>
>Also, I can justify it because once I have the blessed hash setup, I may 
>use it for class variables ;-)
>
>Thanks,
>Tim

Reply via email to