<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
<document>
  <header>
    <title>Design notes</title>
    <authors>
      <person id="jmaerki" name="Jeremias Märki" email="jmaerki@users.sourceforge.net"/>
    </authors>
  </header>
  <body>
    <section>
      <title>Requirements</title>
      <ul>
        <li>
          The whole barcode package shall be flexible and extensible. New implementations 
          (barcode type or output format) should be easy to add.
        </li>
        <li>
          The design shall be done in a way that different barcode types (1D vs. 2D) can 
          be supported.
        </li>
        <li>
          The barcodes implementations shall be configured using XML and in a way that
          the whole package can easily be integrated into a bigger work.
        </li>
        <li>
          The barcode logic (checksums, encoding, character sets etc.) shall be separated
          from the rendering of the barcode so different output formats (SVG, bitmaps etc.)
          can easily be supported.
        </li>
      </ul>
    </section>
    <section>
      <title>Package overview</title>
      <section>
        <title>org.krysalis.barcode4j</title>
        <p>This package holds the primary interfaces for generating barcodes.</p>
        <section>
          <title>Main interfaces</title>
          <ul>
            <li><strong>BarcodeGenerator</strong>: Main interface for generating barcodes.</li>
            <li><strong>BarcodeClassResolver</strong>: Resolves symbolic names to barcode implementation classes.</li>
            <li>
              <strong>BarcodeLogicHandler</strong>: Receives barcode events (similar to SAX events for XML) 
              generated by barcode logic implementations.
            </li>
          </ul>
        </section>
        <p><strong>BarcodeUtil</strong> is an very useful helper class. Have a look!</p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.impl</title>
        <p>
          This package is the home of the standard barcode implementations. Each implementation 
          consist mostly of two classes, a logic implementation and a presentation implementation. 
          The presentation part calls the logic part to generate something similar to SAX events
          but for barcodes (See <strong>BarcodeLogicHandler</strong>).
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.output (and subpackages)</title>
        <p>
          This is where the various output formats are implemented. To implement a new 
          coordinate-based output format the main task is to create a new CanvasProvider 
          implementation.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.tools</title>
        <p>
          This package contains various helper classes used internally.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.cli</title>
        <p>
          This package contains the command-line interface.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.servlet</title>
        <p>
          This package contains the barcode servlet.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.xalan</title>
        <p>
          This package contains the XSLT extension for <jump href="ext:xalan">Apache Xalan</jump>.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.saxon</title>
        <p>
          This package contains the XSLT extension for the <jump href="ext:saxon">SAXON XSLT Processor by Michael Kay</jump>.
        </p>
      </section>
      <section>
        <title>org.krysalis.barcode4j.playground</title>
        <p>
          This package contains the playground GUI application. It's used to play around with 
          barcodes. Have fun!
        </p>
        <note>This is work in progress! Help wanted! Be creative!</note>
      </section>
      
    </section>
  </body>
</document>
