Software Developing: Implementing a ShoutBox on SnipsSnip 
Since a few months ago I noticed that the number of visits were raising although most of the readers won't comment. In my opinion, this behaviour is due to the fact that SnipSnap only allows logged-in users to comment and even though the registration process is quite simple and fast some readers probably prefer to skip the process and not comment at all.
The idea of allowing guests to comment is in the list of features to implement, although since a comment is a snip and a snip needs to have an owner it has implications, such as, who is the owner of such snip - some default user? should be an editor and the snip be locked? - I still haven't find out a good solution so that implementation keeps getting postponed.
Meanwhile, I thought that a good idea would be the existence of a shoutbox. For the ones who don't know, a shoutbox is a chat-like feature that allows people to quickly leave messages on the website, generally without any form of user registration.
It's not my intention to replace the comments with the shoutbox, but it could be a feature that allows interaction with new users, which then might lead to the registration of those users.
On Friday I developed a simple implementation of a
memory-only shoutbox. I'm saying
memory-only because the messages aren't persistent, there's a buffer that keeps messages in
memory only (size is configurable) and after it's full it has a policy of first in, first out (FIFO). Also since it's only in memory if the server is restarted the current shoutbox is lost.
The implementation is very simple and it only needed to create three new objects, the
ShoutBox, the
ShoutBoxServlet and finally the
ShoutBoxMacro.
ShoutBox
The
ShoutBox is the object that is part of the model. Basically
ShoutBox is a wrapper around an application aware map that contains for each one of the application instances that SnipSnap is running a list of shouts. A shout is nothing more than a formatted string with the date, user and actual input.
ShoutBoxServlet
The
ShoutBoxServlet is the controller. It receives data from the interface and after input formatting and escaping (in order to avoid XSS) it passes the information to the
ShoutBox object.
ShoutBoxMacro
The
ShoutBoxMacro is the tool given to the user. It is a component that renders the shouts' list for the current application and also renders an input box to enter new shouts.
A schematic can be found below.

This is the first version and I'm aware that improvements can be done, such as:
- Allow editors to moderate the ShoutBox. Currently shouts are only deleted when they are thrown out of the shout buffer.
- Using javascript to submit and update the shout panel auto-magically.
Any other suggestions, comments and critics are welcomed.