Issue Details (XML | Word | Printable)

Key: CHAIN-19
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Joe Germuska
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Chain

[chain] Provide a mechanism for encoding catalog and command in a single string

Created: 30/Dec/04 07:30 AM   Updated: 02/Jan/08 07:01 AM
Return to search
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File patch.txt 2004-12-31 04:51 AM Joe Germuska 6 kB
Text File patches.txt 2004-12-30 07:31 AM Joe Germuska 5 kB
Environment:
Operating System: Mac OS X 10.0
Platform: Macintosh

Bugzilla Id: 32881


 Description  « Hide
Considering configuring Struts to look up commands, the prospect of repeatedly
using both a catalog name and a command name is starting to look extremely
tedious. It would be nice to have a single String representation of the tuple,
and it probably makes sense to implement support for this in the base classes of
commons-chain, rather than requiring users to reinvent the wheel.

I have implemented a simple method in the CatalogFactory class which decomposes
a string ID into a catalog name and a command name and returns the command it
looks up. Using ":" as the separator, what precedes the ":" is treated as a
catalog name. If nothing precedes the colon, or if the segment before the colon
is not a valid catalog name, then the entire ID is used as the name of a command
in the "default" catalog.

(Should the "no such catalog" condition be an error instead? Should the
implementation be in CatalogFactoryBase instead of in CatalogFactory? My
thought was that that leaves the syntax a bit slippery.)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.