An annotation-based persistence framework

The getter/setter idiom has always been problematic; it allows too-broad access to the implementation of your classes, degrading maintainability as a consequence. The J2SE 5.0 annotation (or metadata) feature provides an alternative....

03/21/05

Write custom appenders for log4j

The Apache Software Foundation's log4j logging library is one of the better logging systems around. It's both easier to use and more flexible than Java's built-in logging system. This article shows you how to extend log4j with a...

12/20/04

More on getters and setters

Allen Holub's past Java Toolbox column, " Why Getter and Setter Methods Are Evil," discussed the downside of the getter/setter idiom. That article presented a design-level solution. (By keeping your design in the problem domain as...

01/02/04

Create client-side user interfaces in HTML, Part 2

This "Create Client-Side User Interfaces in HTML" series continues by examining the HTMLPane sources. Part 2 offers examples of how to customize the JEditorPane to support custom tags and also provides an extended description of the...

11/14/03

Create client-side user interfaces in HTML, Part 1

This article presents a variant on Swing's JEditorPane that makes it possible to specify an entire screen of your client-side user interface (UI) in HTML. JEditorPane is designed to let you put an HTML text component inside a dialog...

10/03/03

Why getter and setter methods are evil

The getter/setter idiom is a commonplace feature in many Java programs. Most of these accessor methods, however, are unnecessary and can severely impact your systems' maintainability. Using accessors violates the basic object-oriented...

09/05/03

Why extends is evil

Most good designers avoid implementation inheritance (the extends relationship) like the plague. As much as 80 percent of your code should be written entirely in terms of interfaces, not concrete base classes. The Gang of Four...

08/01/03

Solve the date-selection problem once and for all

The Java Toolbox column returns with this tutorial about a date-selection widget that displays a calendar and lets you select a date by clicking on it. It heavily uses the Gang of Four Decorator design pattern, so it provides a good...

07/04/03

Programming Java threads in the real world, Part 2

This article, the second in a multipart series on threads, discusses the perils that can arise when you approach multithreading in a naive way. As is the case with the entire series, this article assumes reader familiarity with the...

10/01/98

Programming Java threads in the real world, Part 1

Programming Java threads isn't nearly as easy (or as platform-independent) as most books would have you believe, and all Java programs that use the AWT are multithreaded. This article is the first in a series that discusses the things...

09/01/98

Load More