[aMess - a Messaging Program]

aMess

a Messaging Program

SourceForge Logo

Goals

The three main aMess goals, as described in every pice of text related to it, are Security, Portability and Flexibility, and the topics to cover with Service glue is the last one but having in mind the others two.

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 ..."

Is SOAP enough ??

The answer is yes and no. Is enough for the purpose described in the previous paragraph, but it's not for the flexibility degree intended for aMess.

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.

Regarding the core

As an extra factor we need to write the aMess core with the more adaptive code as possible (also avoiding the problems mentioned so far), and using the SOAP characteristics let the core to achieve certains tasks without being dependable of the transport protocol involved. Mainly if one message needs to be send, then the calling of a method for any transport (and specifying some minimum parameters as message body, heading, sender and destination) will do the trick. As an example, sending an e-mail could be coded as :

    $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.

And the Winner is ...

Everyone of us are winners, the coders, the users, the deployment staff ... and the requirements to achieve this are implementing through :


[aMess documentation]

aMess

a Messaging program