Design Patterns

Design Patterns news, information, and how-to advice

Plug memory leaks in enterprise Java applications

Because Java uses automatic garbage collection, developers think Java programs are free from possible memory leaks. Although automatic garbage collection solves the main cause of memory leaks, they can remain in a Java program....

Generically chain dynamic proxies

Most developers already know how to decorate a business object and add additional behavior to it at runtime. The Gang of Four (GoF) Decorator pattern helps developers achieve this functionality. Under the reflection package, J2SE 1.3...

J2EE design decisions

In this article, an excerpt from POJOs in Action (Manning Publications, January 2006), Chris Richardson presents five questions developers must ask themselves when designing enterprise applications.

Design an MVC framework using annotations

Model-View-Controller (MVC) is a software architecture that separates an application's data model, user interface, and control logic into distinct components so that modifications to one of the components can be made with minimal...

Hook on to Jakarta Commons Chain

The Jakarta Commons Chain framework is a fairly new framework that implements the Chain of Responsibility pattern. In this article, the basics of the framework are discussed, starting with the interfaces Command, Chain, and Catalog....

All aboard for more efficient Web applications

Find out how the Train pattern boosts enterprise performance by efficiently managing concurrent users accessing network resources and taking the load off of your system hardware.

Use Spring to create a simple workflow engine

Spring is a framework that promotes a relatively new programming paradigm known as Inversion of Control. This article deploys Spring in a more general-purpose role as a simplistic workflow engine. A straightforward investigation into...

Create an application-wide user session for J2EE

Despite its comprehensive sets of APIs for writing distributed applications, J2EE does not provide an application-wide session. While Web applications can use the HttpSession facility, this context won't automatically carry over to...

Boost Tomcat performance for static content

PippoProxy is a 100 percent pure Java HTTP proxy designed and implemented for Tomcat that can be used instead of standard Apache-Tomcat solutions. It addresses the need for a Java HTTP proxy in those cases where standard Apache-Tomcat...

Let your Ant enjoy Spring

This article presents an Ant task extension that allows the invocation of an IoC (Inversion of Control) managed object or any unmanaged object. It also shows how OGNL (Object Graph Navigation Language) can be used to easily let Ant...

Dynamic Behaviors in Java

Dynamic Behaviors is a design pattern similar to the Chain of Responsibility pattern that allows applications to change object behavior at runtime by attaching special class instances to the objects being modified. This article...

Gain SQL SELECT functionality in Java

In " Filter Collections," David Rappoport described a simple way to filter collections of objects. In this article, he expands on this idea and shows you how to treat an array or a collection of objects the same way you treat a table...

Foundations of JSP design patterns: The View Helper pattern

This article, an excerpt from Foundations of JSP Design Patterns (Apress, 2004), describes the View Helper pattern and shows how to build a few useful view helpers that you can add to your own toolkit.

Filter collections

This article describes a simple mechanism for filtering collections based on a variable number of criteria. This mechanism could prove useful in a search mask that offers many search criteria that the user can either select or ignore....

The Chain of Responsibility pattern's pitfalls and improvements

The classic Chain of Responsibility (CoR) pattern requires the individual chain node classes to decide whether the next node should be called to fulfill the chain's responsibility. This is a design flaw because, in practice, such a...

Validating value objects

Value objects are single parameters used to combine a set of objects—in most cases, various parameters supplied for a method call. The parameters describe a large number of attributes, which usually are individually checked and most...

Three approaches for decorating your code

In this article, Michael Feldman explains the three ways to implement the Decorator design pattern: inheritance, wrapper, and external. During his discussion, he presents the pros and cons of each implementation.

Let decorated Commands take over

One of the characteristics of software maintenance is having historical or other constraints imposed on your development approaches. This article shows the technique of applying two very popular patterns, Decorator and Command, in the...

Search business objects in enterprise applications using J2EE

Along with the main line transaction-handling component, searching is a needed application component for any distributed enterprise application. This component searches across complex business-object relationship hierarchies...

Art of Java Web development: WebWork

In this article, an excerpt from his book Art of Java Development, Neal Ford introduces the WebWork open source development framework. He discusses its architecture, configuration, and key concepts.

Load More