Weblogs: Intelligent Agents

Specialised or generalised "servlets"

Thursday, February 27, 2003

I started getting to grips with the web-based service of my app last night, since the shell service won't allow editing (yet or never is undecided at this stage). Creating a web-service isn't that tricky, its simply a matter of reading and parsing the HTTP request, then sending back an HTTP status message and Content-type followed by the rest of the content.

The implementation of this webservice could be interesting. There's a few ways I could structure this. One way is to have a web service per knowledge base, all running off different ports, plus an admin one. The other is running it off one port, and just using URLs to define which knowledge base we wanted to work on. My initial impression was for the former, but on reflection the latter is more flexible. And with the URL scheme http://localhost:8056/$driveIdentifier.$kbIdentifier/$topicName/$articleName that enforces the separation between the knowledgebases.

Since I'd need to create a "request object", it might be reasonable to use the standard HttpRequest object. Taking that idea one step further, how about the webservice class is generic and basically a servlet engine, so all the functionality is done in the HttpServlet. This would mean I could then take any generic servlet and get that running in my framework. Can following a standardised format be useful here?

I don't want my webservice doing lots of out.println() like a typical servlet. I'd much prefer a template based approach where editable fields are labelled with identifiers. So the servlet just needs to populate the identifier Hashtable. That way the servlet can focus on the logic and not worry about the presentation and overall structural aspects. In respects to the standardised servlet above trying to make a template part of the actual framework will negate the benefits of extending the standardised servlet and httpRequest structures.


[ Weblog | Categories and feeds | 2011 | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 ]