This document tries to answer frequently asked questions (FAQ) about the Plankton Utilities library.
Plankton is really just a convenient term used to describe the org.barracudamvc.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).
For an in-depth explanation of all the functionality available, please refer to the Javadocs. In brief, however, Plankton addresses the following areas:
org.barracudamvc.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.barracudamvc.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.
Over time, I think we can safely conclude that the most important
(and useful) feature of Plankton may well be the
ObjectRepositoryAssembler. In other words, you really need to
understand what this can do for you...
org.barracudamvc.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.barracudamvc.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.barracudamvc.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.barracudamvc.core.util.logging - Log4j BCategory and
BCategoryFactory classes. Used all over Barracuda.
org.barracudamvc.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.barracudamvc.core.util.xml - XMLUtil makes it easy to convert to / from XML Unicode.
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:
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.