Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Split JSON-Library in two components#1846

Merged
aschemmel-tech merged 3 commits intomainfrom
aschemmel-tech-split-json-lib
Oct 24, 2025
Merged

Split JSON-Library in two components#1846
aschemmel-tech merged 3 commits intomainfrom
aschemmel-tech-split-json-lib

Conversation

@aschemmel-tech
Copy link
Contributor

Resolves: #1432

@aschemmel-tech aschemmel-tech requested a review from 4og October 6, 2025 10:36
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

The created documentation from the pull request is available at: docu-html

@aschemmel-tech aschemmel-tech marked this pull request as ready for review October 6, 2025 10:43
@aschemmel-tech aschemmel-tech requested a review from a team as a code owner October 6, 2025 10:43
@aschemmel-tech aschemmel-tech force-pushed the aschemmel-tech-split-json-lib branch from 832cb66 to f78af61 Compare October 6, 2025 10:55
@4og
Copy link
Member

4og commented Oct 8, 2025

@aschemmel-tech, What is the folder structure for two subcomponents: the wrapper and the nlohmann_json? Do we need to split the requirements.rst document into two documents?
It makes sense to discuss this case in the process community.

:status: valid
:included_by: logic_arc_int__baselibs__json

.. logic_arc_int_op:: Dump
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. logic_arc_int_op:: Dump
.. logic_arc_int_op:: Write

to be consistent with the naming in https://github.com/eclipse-score/baselibs/blob/main/score/json/i_json_writer.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@aschemmel-tech
Copy link
Contributor Author

@aschemmel-tech, What is the folder structure for two subcomponents: the wrapper and the nlohmann_json? Do we need to split the requirements.rst document into two documents? It makes sense to discuss this case in the process community.

@4og
Copy link
Member

4og commented Oct 15, 2025

@aschemmel-tech, thank you. See also the discussion about the comp_req__json__validation:
https://github.com/orgs/eclipse-score/discussions/1239?sort=new#discussioncomment-14636056

@aschemmel-tech aschemmel-tech force-pushed the aschemmel-tech-split-json-lib branch from e9a0c93 to eeb1e5b Compare October 16, 2025 07:23
@aschemmel-tech
Copy link
Contributor Author

@aschemmel-tech, thank you. See also the discussion about the comp_req__json__validation: https://github.com/orgs/eclipse-score/discussions/1239?sort=new#discussioncomment-14636056

removed/merged the validation requirement as requested in the meeting

:realizes: PROCESS_wp__requirements_comp

Due to low complexity, the requirements of the JSON component were not split into the "sub" components
"JSON Wrapper" and ""nlohman_json". Reasoning is the low number of requirements (only about ten).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant quote

Suggested change
"JSON Wrapper" and ""nlohman_json". Reasoning is the low number of requirements (only about ten).
"JSON Wrapper" and "nlohman_json". Reasoning is the low number of requirements (only about ten).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Due to low complexity, the requirements of the JSON component were not split into the "sub" components
"JSON Wrapper" and ""nlohman_json". Reasoning is the low number of requirements (only about ten).
The component split was done nevertheless, because "JSON Wrapper" is implemented as part of the S-CORE project and
""nlohman_json" is reused from open source.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more redundant quote

Suggested change
""nlohman_json" is reused from open source.
"nlohman_json" is reused from open source.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

The component split was done nevertheless, because "JSON Wrapper" is implemented as part of the S-CORE project and
""nlohman_json" is reused from open source.

So the requiremnts for "JSON Wrapper" are documented in :need:`doc__json_requirements`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in "requirements" word

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

The integrity of input JSON data shall be ensured by the user.
The user shall provide a string as input which is not corrupted due to HW or QM SW errors.

Note: This could be achieved by using a safe read-only filesystem for JSON file storage or a CRC protection on the JSON file content.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write "checksum protection" instead of CRC.
The CRC is a specific algorithm for calculating the checksum, and there are others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Requirements Linked to Component Architecture
---------------------------------------------

see the "fulfils" links in static and dynamic architecture below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
see the "fulfils" links in static and dynamic architecture below.
See the "fulfils" links in static and dynamic architecture below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Description
-----------

JSON provides an abstraction layer to unterlying implementations, in first iteration there is only one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unterlying -> underlying

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


JSON provides an abstraction layer to unterlying implementations, in first iteration there is only one
implementation provided. But generally there is a "Wrapper" and an "Implementation" lower-level component.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add an explanation about the exception we have. The JSON writing functionality is implemented in the wrapper currently.

This also means that the comp_req__json__serialization should be linked with the wrapper static architecture and not nlohmann.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, added design decision and moved the requirement fulfillment

:included_by: logic_arc_int__baselibs__json

.. logic_arc_int_op:: Write
:id: logic_arc_int_op__baselibs__tofile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wording "tofile" may be misleading.
We support writing both to file and to a buffer in memory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed operations

@4og
Copy link
Member

4og commented Oct 24, 2025

@aschemmel-tech, looks good. Please squash commits when merging.

@aschemmel-tech aschemmel-tech merged commit 5426561 into main Oct 24, 2025
8 checks passed
@aschemmel-tech aschemmel-tech deleted the aschemmel-tech-split-json-lib branch October 24, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split JSON component requirements into two sets

2 participants