Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

The Transformer's Architecture

Sebastian Hesse edited this page Apr 7, 2015 · 5 revisions

General

This document describes the architecture of YAML Transformer briefly.

Modules

The project has two major modules org.opentosca.yamlconverter.main and org.opentosca.yamlconverter.yamlmodel.

  • main module: Contains main interfaces, a class to interact with the console and converter classes, especially the switchmapper package contains all important classes to create Tosca XML objects from YAML objects (see workflow below)
  • yamlmodel module: Contains model classes representing the YAML document. Main class is ServiceTemplate

There are other directories which contain minor important files or directories.

  • Examples: Contains YAML files which have been converted from real Tosca XML documents
  • org.opentosca.model.tosca: Contains classes for Tosca XML reading/writing
  • org.opentosca.model.staticresources: Contains static resources for org.opentosca.model.tosca
  • YamlUMLModel: Contains yamlmodel classes as UML, but is not maintained anymore
  • YamlToXmlExamples: Old converting examples; will be deleted soon

Dependencies

The YAML Transformer (main and yamlmodel modules) relies on the following important dependencies:

  • org.opentosca.model.tosca: For Tosca XML classes to read/write (marshall/unmarshall) XML
  • com.esotericsoftware.yamlbeans: A reader to read YAML documents in Java
  • com.sun.xml.bind: jaxb-core and jaxb-impl to marshall/unmarshall XML

There are some minor dependencies (take a look at the POM's), but these are the major ones.

Workflow

The workflow is very simple:

  1. Read YAML document and put the content into one ServiceTemplate object.
  2. Convert the ServiceTemplate object to Tosca XML objects (main class: Definition) by using the classes provided in the package switchmapper.
  3. Generate XML document by using the Tosca XML objects.

Each step contains further steps, but this is out of scope.