BlogMatrix
 

Java/JSP vs. Python and the 21st Century

edit David Janes 2008-07-18 12:14 UTC add comment  ·  ·  ·

I'm just starting a project that's using JavaServer Pages (not Java Server Pages) aka JSP for doing "templates" -- i.e. making dynamic HTML content. The first thing I'm trying is really quite simple -- create an object and print out one of it's values.

Here's the relevant class:

public class Entry {
  String hour;

  public String getHour () {
    return this.hour;
  }
}

Java/JSP is big on setters and getters, that is, functions named a certain to get access to object attributes. There's plus and minuses to this, but from a conceptual level I thought it was quite clear that we are thinking "Entry objects have an attribute 'hour'", even if we have to use setHour/getHour to access values.

Now, in Cheetah, Django (and probably Rails, though I haven't looked) you'd access the attribute 'hour' in a template language as follows:

e.hour

Simple -- the last thing you want to be doing in a HTML template is dumping tons of programming language code into it, making it hard to read and maintain. Cheetah is quite clever about this: it looks at 'e' and does all sorts of introspection to figure out how to get 'hour', so you don't have to do that yourself.

So how do we do this in JSP (like in 2008)?

e.getHour()

Give me a break. Maybe there's another way to do this? If there's performance reasons to be wedded to this format (though I can't see it since everything is compiled) why not invent a new syntax like

e::hour

PyLinda

edit David P. Janes 2007-08-22 23:09 UTC add comment  ·  ·  ·

PyLinda is a Linda-like implementation (and JavaSpaces-like, which I'm more familiar with) for Python. The BlogMatrix Platform does a lot of it's work by one process dropping stuff on queues and other processes picking that stuff up.

Just saying.

Aperture - a Java framework for getting data and metadata

edit David P. Janes 2006-09-20 10:38 UTC add comment  ·  ·  ·

This is probably of interest to Enterprise 2.0:

Aperture is a Java framework for extracting and querying full-text content and metadata from various information systems (e.g. file systems, web sites, mail boxes) and the file formats (e.g. documents, images) occurring in these systems.

features:

  • Crawl information systems such as file systems, websites, mail boxes and mail servers
  • Extract full-text and metadata from many common file formats
  • View files in their native applications
  • Ease of use: easy to learn, easy to code, easy to deploy in industrial projects
  • Flexible architecture: can be extended with custom file formats, data sources, etc., with support for deployment on OSGi platforms
  • Data exchange based on Semantic Web standards (e.g. RDF, SPARQL, ...)
file formats:
  • Plain text
  • HTML, XHTML
  • XML
  • PDF (Portable Document Format)
  • RTF (Rich Text Format)
  • Microsoft Office: Word, Excel, Powerpoint, Visio, Publisher
  • Microsoft Works
  • OpenOffice 1.x: Writer, Calc, Impress, Draw
  • StarOffice 6.x - 7.x+: Writer, Calc, Impress, Draw
  • OpenDocument (OpenOffice 2.x, StarOffice 8.x)
  • Corel WordPerfect, Quattro, Presentations
  • Emails (.eml files)