JSON Component Architecture#

JSON Architecture
status: draft
security: YES
safety: ASIL_B
version: 2

Overview#

The component JSON implements functionality for reading/parsing JSON data and also to write. It provides currently only a C++ API.

Requirements Linked to Component Architecture#

See the “fulfils” links in static and dynamic architecture below.

Description#

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

Design Decisions:

It was decided to use the vaJson parser from Vector (see vajson (doc__vajson)), which is ASIL D certified.

JSON writing functionality is provided by the vaJson serializer, which is wrapped by the “Wrapper” component.

Design Constraints:

The feature description states that this component provides a “JSON abstraction layer that can switch between different parsers/serializers under the hood.” Currently vaJson is the only implementation, for parsing as well as for serialization, so nothing is selectable.

Rationale Behind Architecture Decomposition#

The decomposition in a wrapper and an implemetation component already comes from the feature definition, the main driver is to re-use existing implementation(s) and to allow replacing the implementation while providing a stable API.

Static Architecture#

JSON
status: valid
security: YES
safety: ASIL_B
bazel_target: ["@@score_baselibs+//score/json:json","@@score_baselibs+//score/json:json_serializer"]
bazel_type: ["cc_library","cc_library"]
version: 2
coverage: lines 73% · branches 83% · files 16/22

Dynamic Architecture#

Interfaces#

Parse
status: valid
security: YES
safety: ASIL_B
version: 1
Write
status: valid
security: YES
safety: ASIL_B
version: 1

Lower Level Components#

JSON-Wrapper
status: valid
security: YES
safety: ASIL_B

See VaJson (comp__baselibs_vajson) in VaJson Architecture (doc__vajson_architecture) for the vaJson lower-level component.