Thursday 16 July 2009

Eclipse and CTRL-t

To remind myself in the future as much as anything. In interface heavy code bases like EJB3 apps CTRL-t in eclipse is very handy for finding the actual code you want to look at rather than the interface. btw I really need to get out more given how ugly I find "public" keyword on interface methods.

Monday 13 July 2009

Logging hell

How did we manage to make such a mess of logging in Java? Yet another project that has been all the way through log4j, commons-logging (the worst), slf4j and managed to leave traces of all of legacy behind. Need to be brighter than me to work out where the logs are going. slf4j is miles better than commons-logging but don't think I've ever actually needed the abstraction.

Wicket Ajax

(Particular comparison with GWT)

  • pro - very good for HTML only
  • pro - good security - e.g. just as Java removed pointer arithmetic Wicket doesn't expose property paths, ids etc by default
  • con - request synchronized on Session so Sjax
  • con - very heavy server side requirements
  • con - very complex code base
  • con - ugly API compared to Swing etc
  • con - every click goes to server (unlike GWT)
  • pro - very helpful community
  • con - requirement for ids is more annoying than useful
  • con - dual HTML and component tree is annoying
  • con - components must be serialised! Real pain.
  • con - if server state is lost can't just get user to login again as state of UI is on the server.
  • con - more care needed as action runs in same VM as page state (e.g. ensure tx does not fail before updating page state).

Value anti-pattern

It seems painfully common that software engineers decide to build a database on top of a relational database. Your lovely RDBMS can model columns, relations (duh), datatypes in a wonderful way and do all sort of clever optimisations when you query this data. When the wunderkind decides to have a table with columns name and value, to stuff any old rubbish in, they throw away all this good stuff and invent a very broken wheel on top of a very good wheel. Alfresco CMS manages to make very simple things very complicated and slow by using this pattern.