Thanks Martin!
This is exactly the book i have right now but experts opinions are always a 
good idea! :-)
Abstracting calculations in a method would mean  one call from each other 
method right? I would prefer to have done just once (maybe in the constrcutor?) 
but...
Thanks again..
---PedroD.

      From: Martin Gregorie <mar...@gregorie.org>
 To: users@spamassassin.apache.org 
 Sent: Saturday, September 10, 2016 3:33 PM
 Subject: Re: Plugin development help needed...
   
On Sat, 2016-09-10 at 13:09 +0000, Pedro David Marco wrote:
> Hi there...
> i am not an expert OO developer so i am somehow flying blind in here
> and need your help please
> Basically i want to write my own plugin and i have some repeated
> calculations in each and every plugin method that i would like to
> reduce to just one, but i am not sure on how to do it...
> My understanding is that i can do it inside the constructor (the "sub
> new") and put the results in a data structure that can be accessed
> later by any method inside the plugin.
>
... or abstract it into a method. It will help a lot if you learn the
basics of OO programming before tackling a plugin.

See "Programming Perl", aka the Camel book, chapter 12. Written by
Larry Wall, Tom Christiansen and Jon Orwant, pub. O'Reilly.


Martin



   

Reply via email to