How dvreeze/tqa works
Project’s Main Components
• Layered Architecture: Emphasize the three logical layers:
• The Taxonomy DOM Layer (lowest): Provides a type-safe, yaidom-based representation of taxonomy and linkbase documents.
• The Relationship Layer: Resolves XLink arcs from the DOM layer; manages complex constructs like networks of relationships and overriding.
• The Query API Layer (highest): Offers the type-safe API that applications use to query taxonomy data.
• Extensibility Modules: Note that TQA contains extensions (e.g., formula and table support) that augment the base functionality.
• Pluggable Backing DOM Implementations: Illustrate that alternative DOM implementations (e.g., Saxon tiny trees for production and native DOM for testing) can be plugged in.
• Multi-Module Structure: In the file tree you see separate modules such as “jvm”, “js”, and “shared”. The “shared” module encapsulates core functionality that is used across platforms. The “jvm” and “js” folders indicate platform-specific adaptations (for server/desktop versus JavaScript deployments).
• Supporting Infrastructure: Incorporate components such as the console tools (in the “jvm/console” directory), taxonomy builders (in document builder and taxonomybuilder packages), and test suites which drive quality and provide examples of usage.
Relationships and Interactions
• Module Interactions: Map how the “shared” components are used by both the “jvm” and “js” projects, highlighting the dependency flow.
• Extension Integration: Represent extension modules (formula, table) as plug-in components that integrate with the base query API, enhancing functionality without disturbing core layers.
• Pluggability: Indicate that the backing DOM implementation is an interchangeable component that influences how taxonomies are parsed and built.
Architectural Patterns and Design Principles
• Layered Architecture: Clearly denote separation of concerns between data representation (DOM), business logic (resolving relationships), and API exposure (query API).
• Immutability and Thread Safety: Note that TQA is designed to work in multi-threaded environments, assuming that the underlying DOM is both immutable and thread safe.
• Extensibility: Illustrate how extensions (such as for formula and table support) can be integrated without altering the core layers.
• Pluggability: Emphasize that the underlying XML DOM can be swapped (by dependency injection or appropriate factory patterns) based on the use-case scenario.
Relevant Technologies
• Scala and SBT: The project uses Scala (with a “build.sbt” at the top level) as the primary language.
• yaidom XML Query API: This plays a central role as the underlying XML processing engine.
• Saxon Tiny Trees (as an example): For the production environment, the Saxon-based DOM wrapper is highlighted for its performance and low memory footprint.
• Testing and Build Infrastructure: Tools such as Travis CI (referenced by “.travis.yml”) and scripts are present for building and deployment.
• Submodules demonstrating the separation into “jvm” and “js” projects, showing how “shared” underpins both.