Skip to content

Commit

Permalink
docs: add original implementation notes
Browse files Browse the repository at this point in the history
...unearthed from email communication.
  • Loading branch information
stempler committed Sep 14, 2023
1 parent 8946c20 commit 6b8c1a8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ The project consists of three modules:
- **generator** - Code generator for models based on a schema that can be read by hale, includes a basic command line interface.
- **instances** - Convert model objects to and from instances that can be read/written with the hale API. This indirectly allows reading/writing model objects, e.g. from/to XML or GML files

## Project status

This project is a **proof of concept** which means that it was implemented to cover a specific use case to a certain extent and comes with some limitations.

Implementation notes:

- During generation, classes are generated for all types classified by hale as "mapping relevant types" by default, plus all corresponding dependencies. In principle, you can also restrict the output types to a certain selection of types (but this is currently not supported in the CLI).
- There was not much time to invest in the special handling of geometries - the JTS geometries are currently located in the properties explicitly marked as geometry properties (type GeometryProperty), as in hale. Best to look into the "SimpleWriteRead" test (example project) for an example.
- For reading or writing GML with the hale API it is always necessary to load the corresponding schema as well. The reading/writing of the model objects works in a way that they are converted from or to hale `Instance` objects. The meta information stored in the model classes via annotations is used for this purpose. This was the fastest approach to implement in the PoC. One advantage is that the procedure is independent of the type of schema, so one could also process data from a database, for example.
- In the hierarchy of the generated model classes there are still problems with certain XML schema constructs which can lead to conflicts, therefore for the generation of the 3A model approx. 10 classes are excluded which lead to compiler problems. In other places the problem occurs partly also, but should not limit the functionality.
- Generally there is still much potential to improve the naming of classes and characteristics, particularly with anonymous types and Choices/Sequences defined in the XML Schema. In principle, a prefix is provided for the package name, but is not supported in the CLI.

## Usage

### CLI
Expand Down

0 comments on commit 6b8c1a8

Please sign in to comment.