Quality First SoftwareQuality First Software
qflib
Packages
IntroductionPackagesExamplesAPI DocumentationProjects
On this page
Overview
Packaged de.qfs.lib.log and de.qfs.lib.logrmi
Package de.qfs.lib.util
Package de.qfs.lib.config
Package de.qfs.lib.gui
Package de.qfs.lib.option
Package de.qfs.lib.command
Package de.qfs.lib.transaction
Deutsche Version
Überblick
Packages de.qfs.lib.log und de.qfs.lib.logrmi
Package de.qfs.lib.util
Package de.qfs.lib.config
Package de.qfs.lib.gui
Package de.qfs.lib.option
Package de.qfs.lib.command
Package de.qfs.lib.transaction
Overview

qflib is composed of various packages addressing different needs of application development. The following diagram illustrates the inter-package dependencies:

qflib hierarchy

The de.qfs.lib.log package forms the basis for all of qflib, while the de.qfs.lib.util package is used by all other packages except de.qfs.lib.log. On top of these, de.qfs.lib.config and de.qfs.lib.gui are mutually dependent. The de.qfs.lib.option package is based on both of them, while de.qfs.lib.command only needs de.qfs.lib.gui.

The de.qfs.lib.transaction package which was added with version 0.97.0 relies only on the de.qfs.lib.log and de.qfs.lib.util packages. Also in 0.97.0 all classes dependent on RMI were separated from the de.qfs.lib.log into the de.qfs.lib.logrmi package.

Packages de.qfs.lib.log and de.qfs.lib.logrmi

Logging is a commonly underestimated resource in program development. The more complex a program is, the harder it is to locate the source of a problem. Using a debugger helps, but it requires knowledge of the problem area to some extent. Through application of a good logging concept and the use of supporting tools it is often possible to locate trouble spots so well that a debugger is no longer necessary.

Traditional logging a la println, even if it is removable through a DEBUG flag, soon causes trouble due to the following shortcomings:

  • No uniform concept for the structure of messages. Without knowing the source and some measure of importance of a message, coherence is lost. With problems caused by multithreading it gets even worse.
  • No fine grained control over message generation. Often Logging can only be turned on or off as a whole at compile time. When it is turned on, some critical mass is soon reached where performance suffers and the sheer mass of output becomes unmanageable. As a consequence, logging statements which might have been of use again are removed or commented out.
  • Missing tool support. For someone who has to wade through a flood of log messages in a simple text editor the chances of finding anything of value are minimal.

The de.qfs.lib.log and de.qfs.lib.logrmi packages address these problems by:

  • Separating messages into five levels of importance ranging from error through warning and message to method call and debugging. Each of these has a sublevel for details.
  • Providing information about the time, active thread and calling class and method for each message.
  • Controlling generation and dispatch of log messages through multiple filter systems. This reduces performance penalties and increases manageability.
  • Close cooperation with the log server qflog which makes use of these features to provide visualization, sorting and filtering of log messages. It also offers fine grained control over the generation of messages at runtime.

Since the de.qfs.lib.log package is independent of all other qflib packages, it can be separated into its own jar archive if necessary. It also doesn't make any use of the collection classes, so there is no need to provide the collections.jar archive for JDK 1.1 applets that use only the de.qfs.lib.log package.

Links  Examples, API Reference
Package de.qfs.lib.util

The de.qfs.lib.util package is also located close to the bottom of the qflib package hierarchy. It is a collection of little utilities that don't fit in anywhere else, among them:

ArgsParser
A parser for arguments passed to a program via the commandline.
DynamicClassLoader
A ClassLoader that dynamically reloads modified classes at runtime.
MapResourceBundle
An extension of the ResourcBundle mechanism.
MultiMap
An imlementation of the collection classes' Map interface that stores multiple values per key.
Visitor
An implementation of the visitor pattern, also known as multi methods.
Links  Examples, API Reference
Package de.qfs.lib.config

The management of the configuration of a program is a recurring task. Configuration includes user preferences for program parameters as well as persistence for GUI component state like window geometry or table sort order.

The de.qfs.lib.config package simplifies the configuration management and provides persistence by storing the state in a user readable and editable text file. It also features a mechnanism that takes care of geometry management.

Links  API Reference
Package de.qfs.lib.gui

This packge is composed of various classes pertaining to graphical user interfaces. It includes workarounds for some of the weaknesses and shortcomings of Swing.

Its most prominent feature is an extension of the Swing JTable that offers filtering and sorting through a very easy to use interface. There is a little demo called SortedTable.java in the demo directory.

Links  Examples, API Referenz, demo SortedTable.java
Package de.qfs.lib.option

This package combines the concepts of de.qfs.lib.config and de.qfs.lib.gui primarily to simplify the creation of dialogs to edit user preferences, but it is also applicable to any kind of dialog based editing.

The values are represented through Options and edited via OptionEdits. All information about how components are grouped together, layed out and labeled is provided through property files.

Instead of a collection of small examples on the examples page, there is a demo called Options.java in the demo directory.

Links  API Reference, demo Options.java
Package de.qfs.lib.command

The Command pattern has been a benefit to various projects. It is similar to an event mechanism, but at a higher level of abstraction than the AWT event loop.

Senders and receivers of commands can be kept completely unaware of each other. They both act through a CommandDistributor. This enables communication across library boundaries. Exception handling is also simplified through having a common point of entry for user-triggered actions.

Links  API Reference
Package de.qfs.lib.transaction

The de.qfs.lib.transaction package was added to qflib with version 0.97.0. It is useful in handling the effects of transactions at the client side. Simple steps can be collected in a transaction and commited together when everything is OK. In case of an error a rollback will take back everything that happened so far.

Links  API Reference

Last update: 02/17/2001, Copyright © 2000 Quality First Software, Gregor Schmid