[alicebot-developer] ProgramJ

Steve Prior alicebot-developer@list.alicebot.org
Thu, 10 Feb 2005 15:59:40 -0500


Helio Perroni Filho wrote:

> That's good news! But I don't think you need to worry
> about J2EE at all. One of the things that prompted me
> to start ProgramJ was that I wanted to do something
> like:
> 
> AliceBot instance = new AliceBot(someSourceOfData);
> String response = instance.respond(request);

If I'm not mistaken you'll also need to add a context object
to the mix:

AliceBot instance = new AliceBot(someSourceOfData);
AliceBotContext context = new AliceBotContext();
   // one of these for each
   // connection to alicebot from a client
String response = instance.respond(request, context);

That way you can continue to support Alicebot keeping track
of multiple users at the same time and keeping up the
context of the conversation.  In ProgramD this was often
stored in MySQL I believe.  One value add of this architecture
is that you could allow for subclasses of the context object
which tune how the context info is stored - in memory, in a
database with a memory cache (this is how program D does it),
or in the database with no cache and frequent commits (this is
what I personally need to allow a the conversation to be a
"collaboration" of different types of bots which can handle
different types of queries).

Steve