Skip to content

Latest commit

 

History

History
76 lines (47 loc) · 5.12 KB

README.md

File metadata and controls

76 lines (47 loc) · 5.12 KB

Compute Graph

Demo for the Executable (computational) graphs & diagrams medium article.

This demo shows two approaches to creating executable software starting from arbitrary Drawio diagrams which may not follow any notation. The software traces back to the diagram(s) and modifications in the diagrams change how software executes.

The demo uses For this demo a parse-tree.drawio diagram is located in the compute module/folder.

The demonstrated approaches may be applied when there is a body of pre-existing diagrams, or when diagram authors (subject matter experts) are not proficient with diagramming notations. In general, a diagram created by a child might be used to create executable programs.

Direct mapping

With this approach processors are created for Drawio diagram elements, which are graph elements.

Mapping to a a model

This approach uses mapping of a diagram to a semantic model and then providing executability for the semantic model.

Elicit a domain model (metamodel)

You may use an existing model, e.g. one of Nasdanika models, or create a new model. A new model may extend existing models.

In this demo the metamodel is located in the model module.

Document the metamodel

Create metamodel documentation processors. Metamodel documentation processors can be found in the processors/src/main/java/org/nasdanika/demos/graph/compute/processors/ecore package. They are registered as services in the processor's module module-info.java.

Generate metamodel documentation1. In this demo documentation is generated with a JUnit test - TestComputeModelDocGen.java.

Map the diagram to the model

Use diagram element properties to map them to metamodel classes to create a model. The mapping process is explained in the Beyond Diagrams book.

Create documentation processors

You may create documentation processors and generate documentation from the loaded model. In this demo documentation processors are located in processors/src/main/java/org/nasdanika/demos/graph/compute/processors/doc package. The are incomplete.

You may find complete functional processors in https://github.com/Nasdanika-Models/family/tree/main/processors/src/main/java/org/nasdanika/models/family/processors/doc.

With documentation generation you may associate detailed information with diagram elements.

Create compute processors

Follow examples and reference documentation to create compute processors.

To perform computations follow testModelSyncComputeGraph method in ComputeGraphTests.

Currently in this demo there is one set of model processors to perform computations synchronously. You may have multiple flavors of processors. For example:

  • Synchronous computations
  • Asynchronous computations (CompletionStage)
  • Reactive computations
  • Code generation - text or, say, Java model

Please note that you don't need to create documentation processors and generate documentation in order to create compute processors.

Footnotes

  1. Currently the metamodel documentation is incomplete - it was copied from the familiy metamodel.