View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007196 | 10000-003: Address Space | Spec | public | 2021-08-11 08:52 | 2021-09-07 15:46 |
| Reporter | Randy Armstrong | Assigned To | Jim Luth | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Summary | 0007196: StructureField should prohibit fields that have the same DataType as the containing Structure. | ||||
| Description | This is currently allowed but code generators cannot create classes/structures from a DataTypeDefinition that did this. | ||||
| Tags | No tags attached. | ||||
| Commit Version | |||||
| Fix Due Date | |||||
|
|
I think this is perfectly legal (at least is some cases - see below) and should not be prohibited, because it can also be very useful (such as representing general tree structures). In my client library I fully support it. It currently does not generate code (i.e. programming language code) for the datatypes, but it could. The "legality" of it depends on details. Certainly you cannot have a mandatory field of the same DataType. But you can have optional field. Or, you can have a field that is an array of such DataTypes. It becomes actually recursive when there are any elements in the array, but the recursion can be "stopped" when the array has no elements. I coined a term "terminable" for data types that are legal in this way, and make sure any infinite processing does not occur (which would happen with types that are not "terminable"). |
|
|
Submitter agreed to close issue and leave it open in the spec. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-08-11 08:52 | Randy Armstrong | New Issue | |
| 2021-08-11 10:36 | Zbynek Zahradnik | Note Added: 0014721 | |
| 2021-09-07 15:46 | Jim Luth | Assigned To | => Jim Luth |
| 2021-09-07 15:46 | Jim Luth | Status | new => closed |
| 2021-09-07 15:46 | Jim Luth | Resolution | open => no change required |
| 2021-09-07 15:46 | Jim Luth | Note Added: 0014821 |