Static Analysis for ORM Removal in Software Projects

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The continued use of Object-Relational Mapping (ORM) in software projects after deployment can lead to performance issues and is difficult to remove manually, introducing errors and slowing down the production process.

Innovation Solution

A system and method for automatically removing ORM code by performing static code analysis to identify ORM interactions, capturing and converting SQL statements into static, parameterized SQL, and integrating them into the source code, thereby eliminating ORM dependencies.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If ORM is used during rapid development, then development speed is improved, but program performance deteriorates

Engineering Contradiction:
Improvedevelopment speedVSAvoidprogram performance
Core Design Contradiction:
ProductivityVSSpeed

Solution Approach 1:

The system performs preliminary static code analysis to identify ORM interactions before deployment, capturing SQL statements in advance. This allows the ORM layer to be removed or replaced with optimized code before the program runs, eliminating runtime overhead while maintaining development speed benefits

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system extracts SQL statements from ORM code through static analysis, separating the database access logic from the ORM abstraction layer. This extraction removes the performance-deteriorating ORM overhead while preserving the functionality, allowing fast development during creation but optimized performance after deployment

Inventive Principle:
Principle #2Taking out (Extraction)

2Adaptability or versatility

If ORM is used to abstract database dependencies, then adaptability is improved, but device complexity increases

Engineering Contradiction:
Improvedatabase switching capabilityVSAvoidcode complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system performs preliminary static analysis to capture all SQL statements and database interactions before deployment. This upfront work records the database schema and access patterns, allowing database switching after deployment without modifying source code, thus reducing ongoing complexity while maintaining adaptability

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates a copy of the database schema and SQL statements during static analysis, storing them separately from the source code. This copying approach allows database changes to be applied to the copied schema without affecting the original source code, maintaining adaptability while reducing code complexity

Inventive Principle:
Principle #26Copying

3Productivity

If manual ORM removal is performed, then productivity is improved by eliminating ORM overhead, but manufacturing precision deteriorates due to human error

Engineering Contradiction:
Improvedeployment speedVSAvoiderror rate
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The system replaces manual mechanical code editing with automated static analysis and code transformation. The static analysis tool automatically identifies ORM interactions, extracts SQL statements, and generates replacement code, eliminating human error while maintaining fast deployment pace

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system uses feedback from static code analysis to automatically identify and remove ORM interactions. The analysis provides feedback about which code segments use ORM, allowing precise automated removal without human intervention, thus improving both speed and accuracy

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10540157B2Systems to remove object relational mappings from a software project
Publication Date: 2020.01.21 LEVEL 3 COMMUNICATIONS LLC
  • US10540157B2 patent drawing
  • US10540157B2 patent drawing
  • US10540157B2 patent drawing

AI summary

Systems and methods for automatically replacing an ORM code in an object-oriented source code with static and parameterized SQL statements. A source codebase, written in an object-oriented programming language is analyzed to find any ORM interactions. The ORM interactions are executed to obtain SQL statements, which are integrated into a new source code to replace the ORM interactions.