Skip to content

Code Overview

Frédéric Jouault edited this page Dec 20, 2022 · 9 revisions

The purpose of this page is to give an overview of code organisation.

General Principles

  • almost all AnimUML modules are ECMAScript modules
  • most modules that are used in the browser are also used in Node.js
    • therefore, using them may require setting up a browser-like environment
      • for instance, globalThis.WebSocket exists in the browser, but not in Node.js by default
    • this way, these modules do not need to care about where (browser or Node.js) they are executed from

Modules Overview

The following layered architecture diagram represents AnimUML's high-level code organization.

Presentation
Diagram Transformation Analysis
Execution/Semantics External analysis tools
Model Representation
Load/Save Export Code Generation

Some modules corresponding to each element of this diagram are listed below.

Presentation

  • AnimUML.js
  • Editor.js

Diagram

  • PlantUML-based
    • Export2PlantUML.js
      • toPlantUML
        • state machines
      • allObjectsToPlantUML
        • object diagrams
        • class diagrams
        • both with (optional) embedded state machines
      • (private) js2PlantUMLActivity
        • activity diagrams
    • history/trace
      • History2PlantUMLBranchingHistory.js
      • History2PlantUMLSequence.js
      • History2PlantUMLTiming.js
    • StateSpace2PlantUML.js
      • generates a PlantUML model for a complete state space
      • only applicable to relatively small state spaces
  • ATLc/web-based
    • TCSVGSequenceGenerator.js
      • generates TCSVG by wrapping a string containing the appropriate tags
      • uses TCSVGSequenceTemplate.js
    • TCSVGSequenceTemplate.js
      • the templates generated by the ATLc/web compiler

Transformation

  • TransformStateMachine2Explicit.js

Analysis

  • operators on engines
    • SynchronousCompositionEngine.js
    • AnimUMLSmallerStepsEngine.js
    • AnimUMLTimedEngine.js
    • AnimUMLSynchronousCommunicationEngine.js
    • PooledEngine.js
  • analysis tools
    • Explorer.js
    • DiffExplorer.js
    • AnalysisWorker.js

Execution/Semantics

  • standalone engines
    • AnimUMLEngine.js
    • RemoteEngine.js
    • EMIRemoteEngine.js
  • observer/monitor engines, for synchronous composition with another engine
    • ObserverAnimUMLEngine.js
      • simple state machine semantics
      • InteractionEngine.js
        • interaction (sequence diagram) interpreter
        • work in progress

External analysis tools

  • RemoteTool.js

Model Representation

  • Model.js
  • ModelUtils.js

Load/Save

  • Export2AnimUML.js
  • ImportFromAnimUML.js
  • TranslateToPlantUMLSyntax.js
  • CLILoadModel.js
    • for use with Node.js
    • can be used to load different kinds of AnimUML models (JSON, JS, HTML)
  • ImportFromPlantUMLClass.js, ImportFromPlantUMLSequence.js, and ImportFromPlantUMLState.js
    • PlantUML-like grammars/parsers/serializers
  • Preprocessor.js

Export

  • Export2tUML.js

Code Generation

  • Export2C.js

Clone this wiki locally