Java Performance: Map vs If/Else

December 17, 2010

I came across an interesting javascript article the other day on how not to write javascript: Google Closure: How not to write JavaScript The interesting part of this article that caught my eye was using a map instead of a switch or if/else statement to check for string comparisons. This got me thinking of whether [...]

2

Building Annotation-Driven Configuration

December 7, 2010

In the last few years, annotation-driven libraries have been on the rise in new and even existing libraries. Rather than use configuration files such as XML or properties, libraries now make use of annotations in JDK 5 to mix the configuration directly inline with the code. This simplifies the configuration by not having to maintain [...]

0

Creating Transactional Proxy Classes

July 10, 2010

One of the frequent patterns I make use of for Java backend systems are transactional code blocks, and not transactional in the sense of JPA, Hibernate, Databases, etc. I mean generic transactional blocks in which you have to wrap a piece of code with a begin and end block. For example, JPA is just one [...]

2

Simple Performance Improvement with Large Ehcache Disk Store Data Sets

April 29, 2010

One of my applications has several millions cacheable entries.  In order to cache as much as possible without going back to the database I use both a  memory store and a disk store in my Ehcache configuration.  Loading a serialized item from disk is still faster than loading from a database generally.  That being said [...]

3

OneToOne with Hibernate

October 7, 2009

I have a use case within my database schema that involves a one-to-one relationship. Typically, I map most of my tables with an automatic auto-incrementing primary key. The relationship table then has a single foreign key to its single relationship. This works great within Hiberante and HQL without issue. That is until you begin to [...]

3

Using “use index” With Hibernate/MySQL

October 7, 2009

MySQL has the notion of specifying a specific index to use when invoking queries in order to override the default provided by MySQL. Typically, MySQL selects the most optimized index based on the query. However, in some cases, it fails to pick properly reducing performance. In those cases, you need to use the keyword “use [...]

6

Eclipse Galileo (3.5) Released – My Favorite Features

June 24, 2009

Eclipse Galileo has officially been released and with it comes multitudes of changes. Below are my favorites from the Platform, JDT, and Web Tools projects. For more information, including screenshots, see: http://download.eclipse.org/eclipse/downloads/drops/R-3.5-200906111540/eclipse-news.html http://www.eclipse.org/webtools/releases/3.1.0/newandnoteworthy/index.php Mac OSX Builds Use Cocoa and Sheets The platform now uses native cocoa-build SWT widgets, rather than the obsolete Carbon. This brings [...]

0

Common Java Cookbook

June 3, 2009

If you use any popular open source technologies, odds are they use or you have used the Apache Commons libraries.  The following is a free e-book on using those various libraries. Common Java Cookbook

0

JSF: Suggestion for Performance Improvement

May 1, 2009

One of the areas of JSF that I think suffers compared to other models such as JSP, PHP, etc is that it requires two paths instead of one. In JSP, for example, code is compiled directly into Java bytecode. That code is then directly executed when the servlet is accessed. As a result, a single [...]

3

Using Spring For Dependency Management

April 26, 2009

Spring is often times considered a web application library similar to the EJB 3.x stack.  However, Spring is so much more and can live in standalone applications as well.  Today I am going to touch on using Spring in standalone applications to handle dependency or configuration management.  I do not mean configuration management in the [...]

1