Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Parent object is not consistent with the rest of the objects #7

Open
fixbits opened this issue Sep 12, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@fixbits
Copy link

fixbits commented Sep 12, 2022

Dear Team,

The current syntax captures type and id of the parent and represents it as a map entry like syntax where the value of the key entry encodes the type information. This syntax leaves the responsibility of enforcing that a parent is indeed only has a type of trustZone or component to the domain logic after parsing the otm. (First element is deserialized to a one element map, then additional the entry must be validated after creation - I believe a fragile way of checking for consistency. ).

Other elements in the OTM spec however - Representation for example - chose a separate "type" and "id" entry to contain this information. Re-using the same syntax encodes the type information on the syntax level and makes type validation during deserialization possible.

In Java code for example it is quite easy this way to deserialize the element directly to an implementation (either of class TrustZone or that of Component) of the abstract Parent class with a sinlge field ID - what makes perfect sense for an element what is essentially a typed reference to a concrete instance of an other element.

In case this PR is accepted, I would recommend changing the possible types of Parent to trustZoneRef and componentRef (or similar) emphasizing the distinction between the actual parent element and the element referencing it.

Kr. Daniel

@fixbits
Copy link
Author

fixbits commented Sep 12, 2022

Please refer to #6
for a concrete realization suggestion.

@fixbits fixbits changed the title Parent object is not consistent with the rest of the objects [Suggestion] Parent object is not consistent with the rest of the objects Sep 12, 2022
@daFont-iriusrisk daFont-iriusrisk self-assigned this Jul 31, 2023
@daFont-iriusrisk daFont-iriusrisk added the enhancement New feature or request label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants