Four harmful Java idioms, and how to fix them
John O'Hanley reveals the fault lines of four widespread Java idioms, then tickles our brains with new ideas about optimizing Java code for maintainability.
John O'Hanley, July 2008

Save the JMS for last
Don't spend time configuring JMS when you need to be coding business logic. A decoupled application architecture lets you switch from synchronous to asynchronous processing at runtime.
Di Wang, July 2008

Exceptions for action
Is your code overloaded with exceptions? Get some guidelines for writing efficient, reusable exceptions that minimize processing overhead without leaving users or sysadmins in the dark.
Jean-Pierre Norguet, November 2007

REST easy with the JavaBeans Activation Framework
Find out what makes the JavaBeans Activation Framework a perfect vehicle for RESTful data transmission, then put JAF to work in a sample Web application that tracks requests and responses through a Java Servlet-based system.
Jeff Hanson, October 2007

XML data interchange in Java ME applications
Get a primer on the Data Transfer Object design pattern and learn how using XML-based DTOs with a simple tool can speed up the development of Java mobile client-server applications.
Mario La Menza, October 2007

Sidebar: Get started with MockMe

Mario La Menza, October 2007

Acegi Security in one hour
If you've been itching to try Acegi Security, here's your chance for a hands-on introduction. Learn how to set up Acegi's authentication and authorization services for any Java-based Web application, using both standard components and custom implementations.
ShriKant Vashishtha, October 2007

The AjaxCommand strategy for JSF
A new take on the Gang of Four Command pattern lets you handle Ajax requests without duplicating code across multiple JSF components.
Matthew Tyson, October 2007

JSON creator slams Ajax, Web
Rich Web Experience keynoter Douglas Crockford points out the deficiencies of Ajax and the Web, calls for standardization and uniformity in browsers.
Paul Krill, September 2007

Add dynamic Java code to your application
Did you ever wish your Java code could be dynamic like JavaServer Pages? That it could be modified and recompiled at runtime, with your application updating itself on the fly? This article shows you how to make your code dynamic. As such, some of your source code will be deployed, instead of compiled binary code. Any changes to the source code will cause it to be recompiled and the class to be reloaded. Your application will then run on the new class, and users will see the change immediately. This article covers not only runtime source compilation and class reloading, but also a design that separates the dynamic code from its caller. The caller holds a static reference to the dynamic code, and no matter how the dynamic code reloads at runtime, the caller can always access the up-to-date class without updating the reference. In this way, dynamic code changes are transparent to the client.
Li Yang, June 2006

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. Specifically, such memory leaks in complex multitiered applications can be extremely daunting to detect and plug. This article analyzes the main causes of memory leaks in Java Enterprise Edition (Java EE) applications, and suggests strategies for detecting them.
Ambily Pankajakshan, March 2006

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.
Chris Richardson, January 2006

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 introduced the dynamic proxy, which dynamically decorates business objects. Additionally, chaining dynamic proxies can add multiple behaviors to business objects dynamically at runtime. More specifically, these types of additional behaviors are addressed by aspect-oriented programming (AOP). This article is not intended as an in-depth discussion on AOP; rather, it focuses on generically chaining the dynamic proxies so that the developer can implement some AOP concepts in a framework-driven way. If a project is already using some existing AOP framework, then the developer does not need to worry about implementing a custom framework. But developers who, for whatever reason, do not use these frameworks in their projects can still get the advantage of chaining dynamic proxies in an effective way with little effort.
Srijeeb Roy, January 2006

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 impact to the others. In this article, you learn how to design a framework that extends MVC and uses annotations to achieve an (almost) complete decoupling between the model and view.
Riccardo Govoni, October 2005

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. In addition, the reader is introduced to some packages designed for use in Web applications and learns how Commons Chain will be applied in an upcoming version of Struts. Finally, some imperfections are mentioned that are still present at the time of this writing.
Eric Gunnewegh, July 2005

All

Let's talk about exceptions ...
How do you handle exceptions? Do you think upfront about the type of exceptions that you want to catch or do you just let the outside world handle it?

-- Jeroen van Bergen in JW Blogs

Newsletter sign-up

Sign up for our technology specific newsletters.

Enterprise Java
View all newsletters

Email Address: