Barracuda Plankton - Overview
barracuda.gif (11357 bytes)The purpose of this document is to provide a high level overview of the Plankton Utilities Library classes provided within the Barracuda framework.
  1. What is Plankton?
  2. What are the major aspects of Plankton?
  3. What does the Plankton Data Collection provide?

Q: What is Plankton?

A: "Plankton" is really just a convenient term used to describe the org.enhydra.barracuda.core.util.* classes contained within the Barracuda Presentation Framework. Many of these classes address problems that occur across a wide range of problem domains. As such, they can be viewed as belonging to the lower levels of the development food chain, hence the name Plankton.

Plankton classes are used extensively within Barracuda, but as some developers may wish to use these classes in other places as well, Plankton is available as a standalone jar file which can be found in the /WEB-INF/jars directory. Some of the classes may have dependencies on 3rd party libraries (like Log4j and XMLC).


Q: What are the major aspects of Plankton?

A: Well, for an in-depth explanation of all the functionality available, please refer to the Javadocs. In brief, Plankton addresses the following areas:

  • org.enhydra.barracuda.core.util - Miscellaneous classes that don't really belong anyplace else. Classes can be used to see what interfaces any particular Java object implements. Locales and Localize provide some useful localization methods.

  • org.enhydra.barracuda.core.util.data - This package defines the Plankton Data Collections layer, a lightweight extension to the Java Data Collections library which adds several key functional aspects to the basic Map and List interfaces. For more information, see What does the Plankton Data Collection provide?

  • org.enhydra.barracuda.core.util.dom - The DOM classes provide an easy mechanism to read/write DOM based structures. The DefaultDOMLoader class integrates with the Barracauda Localization services to load documents based on a target Locale. The DefaultDOMWriter class supports Node visibility (it won't print nodes that are not visible), and can also handle pretty-printing by using the Tidy formatter. (Depends on XMLC)

  • org.enhydra.barracuda.core.util.exceptions - Contains a handy dandy NestableException class  which can store any number of underlying exceptions and provides a convenient method to find the root exception. There is also an ExceptionUtil class which can dump a NestableException as HTML. Used by the Barracuda Forms Mapping & Validation package.

  • org.enhydra.barracuda.core.util.http - ServletUtil provides a convenient mechanisms to log the contents of HTTP Requests and SessionServices makes it easy to access / cache data in a user's Servlet Session.

  • org.enhydra.barracuda.core.util.logging - Log4j BCategory and BCategoryFactory classes. Used all over Barracuda.

  • org.enhydra.barracuda.core.util.srv - Lightweight service mechanism that can be used in conjunction with the Plankton Data Collections classes. SimpleServiceFinder is a class that can search a hierarchy of objects (both upstream and downstream) looking for classes that provide a given service or implement a specific interface. The SimpleServiceFinder knows how to navigate a number of different hierachies, including those defined by java.awt.Container, EventGateway, PData. It can also examine any Map or List data structures, as well as those which implement SimpleServiceProvider.

  • org.enhydra.barracuda.core.util.xml - XMLUtil makes it easy to convert to / from XML Unicode.


Q: What does the Plankton Data Collection provide?

A: The Plankton Data Collection classes extend the functionality found in the standard java.util Data Collection classes. The UML is available here. In a nutshell, you get PMap and PList data types which provide all the functionality of the standard Map and List interfaces, with 2 key behavioural additions:

  1. All Plankton data structures have the notion of parental hierarchy (they can have a parent). This allows you to navigate bi-directionally (both up and down) through a collection of data. With the standard Java Collections classes, you can only navigate down.

  2. All Plankton data structures carry the notion of state. They do this by implementing the StateMap interface. This is particularly useful when you'd like to use the collection mechanism to assemble a hierarchy of data elements, but you also wish to associate additional "state" data about the various elements (without actually modifying the element data).

For all the latest information on Barracuda, please refer to http://barracuda.enhydra.org
Questions, comments, feedback? Let us know...
Copyright 1997-2002 Lutris Technologies, Inc. All rights reserved.