Archive for the ‘Web Design’ Category

Simple Performance Improvement with Large Ehcache Disk Store Data Sets

Thursday, April 29th, 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 I was running into performance issues due to the constant reads and writes to and from the disk store.   Due to the serialized nature of the data file it would block on subsequent accesses resulting in lag and performance issues.  So, how did I address it?  I decided to partition the single cache into multiple caches.  So, rather than using something like:

ehcache.getRegion(CONSTANT).get(id);

I now use:

ehcache.getRegion(CONSTANT + (id % 10));

I now have 10 different cache regions resulting in less concurrent access and better performance.  A very simple trick when you have extremely large data sets.  Remember, partitioning is always your friend regardless of what type of data you use.

UPDATE: This is being done in Ehcache 1.5.0…I understand there are better improvements in Ehcache 2.x, so please consult the documentation for more information.

Ultimate IE6 Cheatsheet: How To Fix 25+ Internet Explorer 6 Bugs

Friday, September 25th, 2009

Helpful article to handle IE6 when you have to.

Ultimate IE6 Cheatsheet: How To Fix 25+ Internet Explorer 6 Bugs.

Push RSS via RSS Cloud

Tuesday, September 8th, 2009

RSSCloud is a built-in mechanism for the RSS protocol that allows clients to immediately receive updates when new content becomes available. This results in immediate notification rather than polling every hour. Our new iPhone application, RSS Viewer, has had a plan to begin supporting RSS Cloud as soon as servers started offering it. Well, that wait will soon be over. As noted on the Wordpress.com blog, all blogs served by Wordpress.com will have RSSCloud enabled. That means that the RSS Viewer servers that power the RSS Viewer application on the iPhone will be able to connect directly to these feeds and immediately provide updates to your iPhone. In other words, when a new post appears on Wordpress.com (or any other RSSCloud based server), within seconds you will be notified on your iPhone. No more waiting for a few minutes before you get the notification. When a post is added, the RSSCloud system immediately pushes the notification to the RSS Viewer servers which immediately pushes the notification to your iPhone via RSS Viewer.


We hope to have RSS Viewer released this week for the iPhone. As RSSCloud is a server-based feature, we will hopefully have support for it within two weeks.

We have just launched support for RSSCloud and Wordpress.com enabled sites. Check out the video below.

Eclipse Galileo (3.5) Released - My Favorite Features

Wednesday, June 24th, 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:

Mac OSX Builds Use Cocoa and Sheets

The platform now uses native cocoa-build SWT widgets, rather than the obsolete Carbon. This brings the platform more in line with current Mac OSX technologies. Further, it uses Sheets for most popup dialogs to follow the OSX user interface guidelines.

Comparing Microsoft Word Documents

Comparing Microsoft Word documents in Eclipse now uses the native Microsoft Word compare support to show changes between versions. For any project that stores Word documents in source control, this feature may be nice to compare changes between versions…especially in terms of merging updates.

Open Resource Dialog

The Open Resource Dialog now allows the choice of what editor to use by right clicking to the context menu. This is a huge, yet small, benefit. Often times you may want to use a different editor than the default. This new change makes that much easier. For example, if you have custom named configuration files in XML that have an official editor (ie: JSF), you can right click to select the specific editor rather than the default XML editor.

Improved Installation/Plugin Management

Eclipse has greatly improved how plugins are added and managed, especially when adding new plugin sites.

Open Implementation Hyperlink

An Open Implementation hyperlink has been added for overridable methods, which directly opens the implementation in case there’s only one, or shows all the concrete implementations for that method in the hierarchy of its declaring type, using the quick type hierarchy. By default, the hyperlink appears when you hold down the Ctrl key while hovering over an overridable method. You can configure the modifier for this hyperlink on the General > Editors > Text Editors > Hyperlinking preference page.

This feature is a huge bonus, especially when you are navigating through source files trying to process the flow. If the class declares a type as an interface (which is usually the case), then normally you wil ctrl+click to the interface, which is obviously not what you want. This new feature allows you to pick the concrete class that you want to jump to making debugging easier.

Javadoc Viewer and Hover

The Javadoc view and hovers now support the {@inheritDoc} tag and add links to overridden methods (like the Javadoc tool). Moreover, the message for deprecated elements now shows up on top, and relative links are supported (for example, to embed images from the “doc-files” directory or to link to {@docRoot}).

This feature should make viewing javadoc inline when hovering an element easier to follow to click through to.

New JPA Entity Generation from Tables

Dali has a new Entity Generation wizard via a contribution from Oracle. This functionality includes a new wizard that offers additional configuration options.

This makes setting up JPA projects, tables, and entities much easier.

XSLT Source Editing

Content assistance is now available for the XSLT mode attribute. This attribute is on the xsl:template and xsl:apply-templates elements. The assistance will find all available modes that have been defined in the current stylesheet as well as any imported or included stylesheets.

Content Assistance is available for the name attribute on the xsl:call-template element. This will provide proposals of available named templates that can be called. This searches the current stylesheet as well as any imported or included stylesheets.

Content assistance is available for the href attribute on xsl:include and xsl:import elements. This will search the current project for any XSLT stylesheet that is available, and provide it as a possible proposal. It is limited in scope to the current project.

The XSL Tools Editor now supports the Templates View. This allows for drag and drop support of XPath templates into the editor. Users may also use this view to create and maintain new or existing templates.

XSLT Debugger

The XSLT debugger now supports a result view. The view will show the output that has been generated to the current break point. As a user steps through code the view will be updated as well.

During debugging of an XSLT Stylesheet, variables that contain NodeSets are now expandable, allowing inspection of the contents of the Nodes carried

Ajaxian » CSS3 breaking in the design community

Monday, June 15th, 2009

Great article below on developing for both next generation and current gen browsers.  I firmly believe in this approach in developing your site to utilize new features while back supporting older browsers in less dramatic ways.  If sites move to this model, users will have a much more compelling reason to upgrade in order to take advantage of the new features.  If sites continue to operate in both scenarios, users will never see the point and we will continue to be bound by old generation browser technology…something none of us want to see.  I would even recommend using browser advertising (either in an ad demark’d space or as a small header/footer on the page) informing the user that if they upgrade, they can take advantage of several new features in the site.

Ajaxian » CSS3 breaking in the design community.

Sliding Doors of CSS

Friday, May 29th, 2009

The following article shows how to create really cool tabs using pure CSS and cross-browser supported CSS (ie: not CSS3).  The technique can be applied to several other UI designs leaving your site semantically correct while creating visually appealing sites.  Check out the link below for all the details and examples.

A List Apart: Articles: Sliding Doors of CSS.

JSF: Suggestion for Performance Improvement

Friday, May 1st, 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 path is executed to render the content to the output stream. In JSF on the other hand, first a component tree is created and renderers associated with it. Once that tree is constructed and JSF enters the render phase, the tree is walked completely and content is written to the output stream. Thus, JSF requires two paths: one to create the tree and one to render it. As a result, JSF has overhead associated with it. On the plus side, that overhead buys the developer a much improved programming model and better MVC implementation. The component tree is a stateful tree that allows state to be associated to components (ie: a value for an input component). This allows JSF to have a very clean model for performing validation, actions, and rendering. However, I believe that the tree mechanism can be improved from a performance standpoint.
(more…)

Using Spring For Dependency Management

Sunday, April 26th, 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 sense of CMS, but in the sense of handling and creating inner-dependencies between business objects, especially in the aspect of singletons.  One of the biggest issues with applications is high coupling by having to have objects create other objects, assign the relationships, and manage those dependencies.  However, one of the primary goals of any application is loose coupling, which in turn reduces maintenance.  Some of the traditional ways of handling these types of scenarios include:

  • Factories that create the instances and setup the dependencies.  While this abstracts the configuration to a factory, it still requires high coupling in the factory to talk to other factories and know about the objects and their inner dependencies.  It also requires static classes for the factories typically, which reduces testability.  My general rule of thumb is to reduce static classes in order to improve pluggability and testability.
  • Custom XML configuration to setup the dependencies and objects.    This pattern abstracts away all the coupling, but requires yet another XML format to be defined, a custom parser to be written, etc.  This can be a tedious operation depending on how fine grained and customizable the format is.

Spring offers a much better approach to this.  It allows you to use either annotations or XML configuration to setup the dependencies.  The difference with Spring’s XML configuration is that it is highly dynamic and flexible and offers several capabilities.  Further, Spring offers other support including AOP in order to separate and handle cross cutting concerns.  For example, you can easily add security or logging around any method invocation without the associated class having to manage that relationship.  In the end, your objects only deal with the objects they must directly deal with resulting in very loose coupling and high testability.

(more…)

Scalable NIO Servers - Part 4 - Protocol

Monday, April 20th, 2009

Now that I have narrowed by server down to using JBoss Netty, it’s time to define protocols. This involves two things. First, we need to select the actual protocol itself and second, we need to define how to construct the handlers. Let’s start by defining the handlers. Netty is built upon the principle of handlers, which are more or less the same idea as filters in web applications. This allows you to define functional handlers that perform specific tasks such as compression, security, and business logic. In this manner, one handler does not need to concern itself with another handlers and handlers can be added/removed without affecting the system. However, order and dependency does matter in certain cases. For example, if you have a handler that depends on a translation of bytes into a POJO, then the handler performing the translation must be in the pipeline and occur prior to the application logic. Generally, a semi-complex, yet real world application, for a protocol stack would consist of:

  • Encryption Handlers via SSL processing, handshakes, etc. These handlers take the data stream, decrypt it, and pass the decrypted bytes down the stream
  • Compression Handlers via GZip processing for instance. These handlers take the data stream, uncompress it, and pass the uncompressed bytes down the stream
  • Transport Protocol Handlers for converting transport protocol data in protocol messages such as HTTP. Subsequent handlers use the protocol-specific messages (ie: HTTP message) for interacting with the protoocol data
  • Security Handler for performing security in terms of authentication and authorization checks. These handlers read a header or portions of the data stream and validate the data as being both a valid, authentication user as well as being permissible or authorized or view/modify the associated data
  • Application Protocol Handlers for controlling an actual underlying application/business protocol. These differs from the transport protocols in that they specify the actual business data and commands to perform on the business data. Often times, these handlers parse out a given business command, convert to a business message or POJO, and invoke a business delegate object or handler to process the data
  • Application/Business Handlers for processing business logic related to a specific protocol message.

This type of stack allows easy extensibility and customization. Future handlers can be added in as needed and future application messages can be added in through custom delegates. It also allows the business logic code to only contain business logic without concern for security, compression, etc. The business logic deals solely with business objects and the business protocol. Further, because of this abstraction and because of the abstraction of the transport layers in Netty, supporting other transport protocols such as UDP, serial, USB, etc is an easy task.

(more…)

Quince / Home

Friday, April 17th, 2009

Just like software, user interface design or user centered design has patterns as well.  The following are a collection of various patterns with examples to sites that deploy them.  This is a very good collection of web-based patterns for your current and future web applications.

Quince