Start with the transmorpher (programer)

The behavior of Transmopher is now (12/12/2001) based on a many step process:

Intermediate processes can be made there:


    1) the interpration process
    2) The execution process
    3) The classes organization
    4) The XML port class
    5) The ProcessFactory
    6) The stack in the application
     
  1. The interpretation process

  2. The interpretation process of the process file, is in two step.
    - Firstly : each rule set / querry instruction are convert into  a XSL file
    - secondly : each component are build; and, when all components in a groups are defined, we link each component.
    The link method is done between XML_Port. An XML_Port is an entity wich allow to link easily different component. With this class, we can make abstraction of the component currently linked.
     
  3. The execution process

  4. During the process, each reader (or generator) are in a thread, and the provide information according to the ContentHandler interface.
    each component (transformation, dispatcher, connector) read these informations continously.
    At the end of the process flow, serializer wrote the results files.
     
  5. The classes organization

  6. The process organisation is quite simple (see Figure 1.0):
      - an interface TProcess define the basic method that each process must provide
      - an class TProcess_impl provide an implementation for this interface
      - two class inherit from this implementation :the TBasicProcess and the TCompositeProcess
      - The basic process class provide functionnalities for elementary element (currently nothing, exept a common class to call all sub process)
     - The composite process provide a way to agregate a set of elementary element. This class overide the copy methode to copy all the elements inside the composite.

      - The transmorpher package provide also a set of basic classes :
          + Connector  : this class allow to translate a set of xml flow to one xml flow
          + Generator : this class allow to produce a XML flow
          + Dispatcher : this class allow to translate one XML flow into several XML Flow
          + Serializer  : this class allow to write XML flow to file
          + Ruleset : This class use the ruleset define in the process file and apply it to the XML flow
          + External Transformer : This class apply a transformation defined in a XSL file at a XML flow
          + Loop : This Class provide two functionnality
                    - a finite loop : for example, a process is apply X times.
                    - a conditionnal loop : a process is apply until a property is true.
          + Query : This class allow the author to apply querry on the XML flow (select one element, a set of element )

    Implementation notes :
      The querry class does not inherite from the TProcessBasic class, because, as this class is also a parser, it's simply to inheite from XMLReader, and implements the TProcess interface.

    Figure 1.0 : Organisation of Transmorpher Classes


             // Create a copy of this element in the composite given in parameter
            // This method is call when a process is used twice or more, in these case, we must
            // copy the process, and insert it in an other part of the process graph
       
      // The getIn and getOut methods are mainly call by the link method
       XML_Port[]  getIn()
              //  Get the In ports
       XML_Port  getIn(int i)
              //  Get an In port
       XML_Port[] getOut()
              //  Get the Out Ports
       XML_Port  getOut(int i)
             //   Get an Out Port
      ...........
       


      A TGenerator provide a f function :
          void execProcess() ;
         // this fonction is call after the parsing of the process file. The call of this function imply the creation of an XML flow, and the generator provide sax event in this output channel.
       

    1. The XML port class

      1. The XMLPort class is one of the most important class. Indeed this class allow to link the different process, and allow to make asbtraction of the other process during the creation of a process.
         
    2. The ProcessFactory

      The ProcessFactory, is also important :). this class, allow to make abstraction during the parsing step of the process used.
      For exemple, if the user wrote : <Reader type="xml" .....> the processFactory provide to the parser a process which is able to parse XML file.
      This class also, allow to extend/modify the basic set of processes without modifying the parser.

    3. The stack in the application

      The connector class needs to store informations. Endeed, during the process execution all inpute send information. The connector, needs to store informations of some input, until the first input is ended. At the end of the first input, it must send the information of the second input to the output, and so on .... 
      So to do this, we stored the information in stack. An other implementation choice is too take advantage of the SAX specification : 
      An input doesn't provide a new event until the previous one was compute by the listener. But this choice needs to take care of the thread implementation.


http://transmorpher.gforge.inria.fr/doc/start_programmer.html

Feel free to comment to Transmorpher, $Id: start_programmer.html,v 1.6 2005-10-25 13:34:00 euzenat Exp $