psteitz     2003/12/29 23:10:25

  Modified:    uid/xdocs index.xml
  Log:
  Added some basic usage notes.
  
  Revision  Changes    Path
  1.2       +35 -3     jakarta-commons-sandbox/uid/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/uid/xdocs/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml 24 Dec 2003 08:59:45 -0000      1.1
  +++ index.xml 30 Dec 2003 07:10:25 -0000      1.2
  @@ -4,7 +4,7 @@
   
    <properties>
     <title>Overview</title>
  -  <author email="[EMAIL PROTECTED]">Commons Documentation Team</author>
  +  <author email="[EMAIL PROTECTED]">Commons Documentation team</author>
     <revision>$Id$</revision>
    </properties>
   
  @@ -12,7 +12,39 @@
   
   <section name="The Uid Component">
   
  -<p>Commons Uid is a component used to generate unique identifiers.</p>
  +<p>
  +  Commons Uid is a component used to generate unique identifiers.
  +  Several identifier-generation algorithms are supported by Generators included
  +  with the package.  The framework is extensible to support additional 
implementations.
  +</p>
  +<p>
  +  A utility class, <code>IdentifierUtils,</code> provides access to singleton 
generators and
  +  methods to generate identifiers without explicitly creating a Generator.
  +</p>
  +<p>
  +  For example, to generate a sequence of Alphanumeric identifiers, starting with
  +  ""000000000000001" and increasing sequentially, you can just repeatedly call
  +  <source>
  +      IdentifierUtils.nextStringAlphanumericIdentifier();
  +  </source>
  +  The underlying Generator used in this case is a static field of the 
  +  <code>IdentifierUtils</code> class, exposed publicly as 
  +  <code>IdentifierUtils.STRING_ALPHANUMERIC_IDENTIFIER_GENERATOR.</code> 
  +  The Generator implementation (like all others in this package) is synchronized.
  +</p>
  +<p>
  +  You can also create Generators explicitly using the 
<code>IdentifierGeneratorFactory</code> 
  +  abstract factory class.  To get an Identifier Generator instance, first get a 
concrete
  +  factory and then use the appropriate instance creation method:
  +  <source>
  +    IdentifierGeneratorFactory factory = IdentifierGeneratorFactory.newInstance();
  +    StringIdentifierGenerator generator = factory.alphanumericGenerator();
  +  </source>
  +  Then you can use the Generator to generate identifiers:
  +  <source>
  +    String id = generator.nextStringIdentifier();
  +  </source>
  +</p> 
   <br/><br/>
   </section>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to