aMessa Messaging Program |
With the common use of Perl we achieve high Portability, with the security constraints imposed to each piece of data the Security goal is in progress, and using modules (Perl modules) we can attach to Flexibility ... well, sort of.
Let me explain myself. We can reuse a lot of code through Perl Modules or incorparating some code from other projects, but true flexibility will let us use code from other projects even if they were wrote in other languages, and (why not) it resides in any other part of the world (did I think Universe ??).
This would be recolutionary if I began to work with these concepts in the eighties, but right now in the year 2002 this have been achieved. The answer is SOAP (Simple Object Access Protocol).
Mainly, "SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing remote procedure calls and responses. SOAP can potentially be used in combination with a variety of other protocols ..."
When used with HTTP each object (and its methods) can be seed as URLs, where the data is passed in the body of an HTTP request using a predefined XML template. Then, instead of calling a method like:
use PerlModule; $handler = PerlModule->new(); $return = $handler->some_method( $param_1, $param_2 );it is called through a SOAP wrapper for the PerlModule (in this case we use SOAP::Lite) :
use SOAP::Lite; $handler = SOAP::Lite -> uri('PerlModule') ## Object to instantiate -> proxy('http://localhost/'); ## URL that hosts the object $return = $handler->some_method( $param_1, $param_2 )->result;There's not big deal and the difficult part is to rewrite a lot of code with the same pattern (and the whole system testing), that is made easy thanks to copy and paste.
Now suppose that we have the complete system converted to SOAP, but the module is replaced (remember that can be hosted by us or any other one in the Universe) and it adds a third parameter ... crash! poof! sock! ... all calls must be modified to satisfy the changes (meanwhile it complains on the number of parameters passed, etc.).
As you correctly guessed (extrapolated ??), the same occurs for the returned value ... some more info can be added, etc. and the behaviour and reliability is dramatically affected.
$from = 'someone@anydomain.com'; $to = 'aMess-devel@lists.sourceforge.net'; $body = ... ## Some fancy text $header = ... ## My brain is dead here $transport = 'SMTP'; send_message ( $from, $to, $body, $header, $transport );now if the code is for sending an IM (Instant Message) :
$from = 'Bit-Man'; $to = 'Duffy Duck'; $body = ... ## Some fancy text $header = ... ## My brain is dead here $transport = 'IM'; send_message ( $from, $to, $body, $header, $transport );Woooooow ... pretty simple and Universal. Of course this is achieved through a bit of tricky code, but it has agreat value.
aMessa Messaging program |