Wednesday, May 05, 2004

EtherYatri.NET Vs Java Based Mobile-Agent Tookits

I was asked about the advantages of my .NET based
mobile-agent toolkit, EtherYatri.NET over other mobile-agent toolkits for Java. I thought, I should present them here for everyone to read.


  • EtherYatri.NET can be used from any CLS compliant language, e.g. C#, J#, VB.NET, MC++, etc. Thus, you can write mobile-agents in the language of your choice.

  • EtherYatri.NET integrates with Visual Studio.NET, and makes the writing of
    mobile-agent based distributed apps easier, by providing wizards.



  • Simpler inter-agent communication. To allow one of its public methods to be
    invoked by other agents, all that an agent needs to do, is mark it with the AgentWebMethod attribute.


    [AgentWebMethod]
    void HelloWorld()
    {
    return "Hello World!";
    }




    To do a similar thing in IBM's Aglets SDK, you'll need to implement the handleMessage method,
    of the Aglet class, in the following manner.


    public boolean handleMessage(Message msg)
    {
    if (msg.sameKind("helloworld"))
    {
    HelloWorld();
    return true;
    }
    return false;
    }


    Now, consider that your agent needs to handle some 20 different kind of messages. With Aglets, your handleMessage method would end up looking something like this:


    public boolean handleMessage(Message msg)
    {
    if (msg.sameKind("msg1"))
    {
    handle_msg1();
    return true;
    }
    else if (msg.sameKind("msg2"))
    {
    handle_msg2();
    return true;
    }
    else if (msg.sameKind("msg3"))
    { handle_msg3();
    return true;
    }
    else // So on and on...

    return false;
    }


    Imagine, how complicated your handleMessage method would look! Further, Aglets' has a pretty unnecessarily ugly way to pass-on args, and return results to callers from your message handlers.

    Fortunately, with EtherYatri.NET, you don't need to define a method like handleMessage. Thus, you can simply mark methods like handle_msg1(), handle_msg2(), etc, with the AgentWebMethod attribute, and other agents can directly invoke these methods to communicate with your agent, like they normally invoke methods on objects.

  • With EtherYatri.NET, you can take advantage of the full-array of the .NET tools and technologies in your mobile-agent applications.

    EtherYatri.NET is currently under development. Please join the EtherYatri.NET project, if you would like to influence its development to improve it. You may download the latest version of the toolkit, from here.
  •