Uploaded image for project: 'Commons Chain'
  1. Commons Chain
  2. CHAIN-19

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.1
    • None
    • None
    • Operating System: Mac OS X 10.0
      Platform: Macintosh

    • 32881

    Description

      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.)

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--patch.txt
          6 kB
          Joseph Lad Germuska
        2. ASF.LICENSE.NOT.GRANTED--patches.txt
          5 kB
          Joseph Lad Germuska

        Activity

          People

            Unassigned Unassigned
            germuska Joseph Lad Germuska
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: