Configurable JSON Parser Rules for Format Changes Without Code Edits
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems require modifications to source code and extensive regression testing when JSON resource formats change, leading to resource consumption and potential adverse effects.
Innovation Solution
An open JSON parser that uses a configurable adapter to read and write JSON resources by modifying a rules file instead of the application's source code, allowing format changes without affecting the application's functionality.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the JSON resource format is changed, then the data structure can be updated to meet new requirements, but the source code of all applications that access the data must be modified accordingly
Solution Approach 1:
The patent introduces a configuration file as an intermediary layer between the application source code and the JSON data structure. This configuration file contains path information that maps application data requests to the actual JSON structure. When the JSON format changes, only the configuration file needs to be updated, not the source code, thus resolving the contradiction between format adaptability and code complexity
Solution Approach 2:
The patent segments the data access mechanism into two independent parts: the application source code and the configuration file. This segmentation allows the configuration file to independently adapt to JSON format changes without affecting the source code, reducing the coupling and modification complexity
2Adaptability or versatility
If the source code is modified to accommodate JSON format changes, then the application can continue to function with the new format, but extensive regression testing is required to ensure no adverse effects
Solution Approach 1:
By using the configuration file as an intermediary, the patent isolates format changes from the source code. This means that when JSON formats change, developers can update only the configuration file without modifying source code, thereby eliminating the need for extensive regression testing and reducing time loss
Solution Approach 2:
The configuration file is prepared in advance with all the path mappings and data access definitions. This preliminary configuration allows the application to adapt to different JSON formats without requiring code changes or retesting, as the adaptation logic is already established in the configuration file
3Ease of operation
If a configurable adapter is introduced to read and write JSON resources, then format changes can be made without source code modifications, but the system complexity increases due to the additional configuration management
Solution Approach 1:
The configuration file serves as a simple intermediary that bridges the application and JSON data structure. It uses straightforward path mappings that are easy to understand and modify, reducing the perceived complexity while improving ease of maintenance
Solution Approach 2:
The configuration file uses simple string parameters to define data paths and mappings. These parameters can be easily changed to accommodate format variations without requiring complex logic or management overhead, thus improving ease of operation without significantly increasing system complexity
Data Source
AI summary
An open JSON parser can be configured to parse different JSON resources without modifying source code. When the format of a JSON resource (e.g., a JSON file) is changed, a corresponding rules file is modified to reflect the change. An application requests data from the JSON resource using an open JSON parser. The open JSON parser uses the rules file for the JSON resource to determine how to retrieve the requested data. By modifying a rules file for an open JSON parser instead of modifying the source code of the application, efforts involved in maintaining applications that make use of JSON resources are reduced.


