Skip to content

Commit 7436b49

Browse files
authored
docs: Add section Technical restrictions (#1052)
1 parent 7dbb0e4 commit 7436b49

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ Contents
3131
:maxdepth: 2
3232

3333
Fundamentals <fundamentals>
34+
Technical restrictions <restrictions>
3435
Data Model Overview <api/modules>
3536
BusinessObjects <api/bo4e.bo>
3637
Components <api/bo4e.com>
3738
Enumerations <api/bo4e.enum>
3839
Versioning <versioning>
3940
Release Workflow <release_workflow>
40-
Contributing <contributing_guide>
4141
Changelog <changelog>
42+
Contributing <contributing_guide>
4243
Authors <authors>
4344
License <license>
4445

docs/restrictions.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
======================
2+
Technical restrictions
3+
======================
4+
5+
There are some technical restrictions throughout the BO4E data models which are important if you want to use it.
6+
There are several reasons for these but mostly due to compatibility reasons as we want to design the data model
7+
such that it can be implemented in most programming languages.
8+
9+
* The data model is generally not object oriented. The reference implementation (BO4E-Python) uses inheritance
10+
to save some code but the generated JSON schemas do not contain any information about inheritance as it is not
11+
supported by the official JSON schema structure. As a result, the following constraints apply:
12+
13+
* You can only differentiate BOs and COMs by using the enums `BoTyp` and `ComTyp`. They are not directly
14+
referenced from the data model but are rolled out to support developers if they need to differentiate the
15+
types.
16+
* There will be some redundancy in terms of field definitions.
17+
18+
* In general, BOs won't be referenced by COMs but it's not prohibited. In fact, there are some cases in which a COM
19+
references a BO. Keep that in mind when designing a package structure e.g. to prevent circular import errors.
20+
* There are no circular references. This means, when drawing a reference graph of BO4E there will be no loops.
21+
22+
* As a result, we cannot directly support `n x m`-relationships as they would require a back-reference.
23+
If you're designing a database structure you have to manually add these relationship tables where needed.
24+
25+
* We won't use a `Union`-type which is represented in JSON schemas as `anyOf` except for a nullable type. I.e.
26+
the type can never be a union of two or more types which are not `null`.

0 commit comments

Comments
 (0)