Static Analysis for ORM Removal in Software Projects
Find Innovative SolutionsGenerate 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
Engineering Contradiction Analysis
1Productivity
If ORM is used during rapid development, then development speed is improved, but program performance deteriorates
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
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
2Adaptability or versatility
If ORM is used to abstract database dependencies, then adaptability is improved, but device complexity increases
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
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
3Productivity
If manual ORM removal is performed, then productivity is improved by eliminating ORM overhead, but manufacturing precision deteriorates due to human error
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
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
Data Source
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.


