MVC framework (again!)

Sorry for being so quiet. After being frustrated with JSF — don’t get me wrong, it’s good, but it’s not there yet — I decided to write my own. It’s loosely based on JSF and the way Interface Builder works under Mac OS X.

At the moment, it only does dispatches (requests in, response out, etc). I may or may not add declarative validation, but I will definitely keep JSP. I believe JSP, coupled with JSTL, still has a lot of potential.

The framework is useable at the moment, but just not ready for opening to public eyes. I am not sure how long it will stay that way, but I would like to mention that it is already being used for my own projects. If I never put it out there, it will still be serving me. Look out for that particular extension at the end of the URLs. Will it be jspa, jspc, exec? Take a guess :-)

Now, some code candy.

Technorati Tags: ,

Referencing a superclass from a subclass in JPOX

In JPOX, when referencing a superclass from a subclass, say, Message descends from Post and has a parent of type Post, do not use the no-table inheritance strategy for the superclass.

Doing this will cause JPOX to fail since the parent post record will not be found because there is no table for the Post class. One can either leave it to JPOX to choose the correct strategy or specify the new-table one.

Technorati Tags: ,

HOWTO: Improved JPOX integration with NetBeans 4.0

This is an improved version of the integration of JPOX with NetBeans 4.0. This one makes use of the Library Manager feature that NetBeans 4.0 provides and allows project dependencies to be assembled in libraries. This eliminates the need for the developer to copy files for each and every project.

# Create a JPOX library by clicking on Tools -> Library Manager -> New Library and adding the JPOX JAR files.
# Add the library to the project by right-clicking on the project, selecting Properties… and following the prompts.
# Select the JPOX library from the list.
# Add the following code extract to build.xml.

Note that the enhancement is done right after the compilation (-post-compile) instead of just before the project is packaged. This has the advantage of working with any type of project that performs a compilation.

Technorati Tags: ,

HOWTO: Filter spam efficiently

This tip will not make spam go away, but it will help you cope with it better.

People prioritise their email based on perceived urgency and importance. Browsing their inboxes, they open messages with interesting subject lines and discard those that are obviously spam. This is a process that most people manage to do in a very short time. The problem lies with those messages that they are not too sure about. Is there spam behind this subject line or not? To make sure a message that looks and feels like spam is not actually the job offer one has been waiting for the whole week, reading is obligatory. Now, there can be several of these on a typical day, which makes the process longer. Although spam is harmful in many ways, it impacts people most by making them waste their time and experiencing that constant frustration. Call it 0-10 frustrations in 10 messages.

For too long, the emphasis has been on filtering out spam from legitimate messages. The downside is that, although spam ends up in a separate corner of the e-mail application or is flagged as such, it still has to be checked for false positives. The simple solution that I came up with and have been using for some time, despite the excellent spam filter in Mail.app, is to assume that all incoming messages are spam and that only a small subset is legitimate. Most of the time one knows the senders and/or the subjects of genuine e-mail. Very rarely does one get correspondence from unknown sources or about subjects they are not aware of. Therefore, the rest can be considered as spam, and the solution is to emphasize on those messages that one knows are genuine. This can be done as follows.

  • Create folders for known correspondents and/or subjects
  • Create filtering rules to move incoming messages to the appropriate folders and leave the rest in the inbox.
  • If your e-mail client allows rules to check if a sender is in the address book, this can be used as another filtering mecanism.

It is very important that as many rules as possible are created so that the least number of messages remain in the inbox after they have been applied.

What this technique does is to reduce the time it takes for one to browse the inbox, picking up legitimate messages and deleting spam. It works by putting real people’s e-mail in separate folders where they can be quickly accessed and leaving out spam in the inbox. As I say, it works for me because I know who will send me messages (known correspondents, automated mail lists, etc.) and what the subjects will be about. Coupled with a smart spam filter tool, this technique can help save valuable time to concentrate on more important tasks.