Object-Relational Mapper Customization for Relationship Traversal

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The object-relational impedance mismatch arises from the need for constant conversion between object-oriented and relational data forms, leading to performance issues and difficulties in managing complex relationships in relational databases, where relationships are not inherently understood and must be explicitly queried.

Innovation Solution

An object-relational mapper is extended to allow customization of relationship loading, enabling developers to override default behavior and specify custom actions for loading objects and relationships, which can be transparent and applied at various levels of granularity, including per-relationship, using mechanisms like stored procedures and dynamic queries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If O-R mappers use default object relationship loading, then the system is simple to operate, but the system lacks flexibility and control over loading strategies

Engineering Contradiction:
Improveease of useVSAvoidflexibility
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The system dynamically adjusts the loading strategy based on configuration. The O-R mapper can switch between default automatic relationship loading and customized loading strategies (e.g., lazy loading, eager loading) depending on runtime parameters or metadata annotations, allowing the system to be both easy to use and flexible when needed.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent allows changing the loading behavior through parameters such as configuration flags, annotations on entity classes, or runtime settings. These parameters control whether relationships are loaded automatically, lazily, or with custom logic, enabling flexibility without complicating the basic ease of use for standard scenarios.

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If developers specify custom loading actions for relationships, then the system gains flexibility and control, but the system complexity increases

Engineering Contradiction:
ImproveflexibilityVSAvoidsystem complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary configuration layer (such as metadata annotations, XML configurations, or fluent API calls) that mediates between the simple object model and the complex loading logic. This intermediary allows developers to specify custom loading behavior without directly modifying core mapper logic, thereby managing complexity while maintaining flexibility.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the loading logic into separate configurable units per relationship or entity type. Instead of a monolithic loading strategy, each relationship can have its own loading configuration (e.g., which relationships use lazy loading, which use custom queries), allowing flexibility without overwhelming system-wide complexity.

Inventive Principle:
Principle #1Segmentation

3Ease of operation

If relationships are loaded eagerly by default, then data access is simplified, but performance deteriorates due to unnecessary data loading

Engineering Contradiction:
Improvedata access simplicityVSAvoidperformance
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The system dynamically determines loading timing based on actual usage patterns. Relationships can be configured to load eagerly only when needed (through annotations or configuration) while defaulting to lazy loading otherwise, thus maintaining simple data access syntax while improving performance by avoiding unnecessary database queries.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent allows preliminary configuration of loading strategies at entity definition time rather than runtime. Developers can annotate which relationships should be pre-loaded (eagerly) and which should wait for access (lazily), enabling performance optimization without complicating data access operations.

Inventive Principle:
Principle #10Preliminary action

4Adaptability or versatility

If developers must construct explicit queries to gather relationship information, then control over data retrieval is improved, but the difficulty of operation increases

Engineering Contradiction:
ImprovecontrolVSAvoidoperational difficulty
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The O-R mapper performs self-service by automatically generating and executing the necessary SQL queries to load relationship data based on the configured loading strategy. Developers simply specify what relationships to load (or not load), and the mapper handles query construction, joining, and data retrieval automatically, maintaining control while reducing operational difficulty.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent introduces an intermediary configuration mechanism that sits between the high-level object model and the low-level SQL query construction. Developers configure loading behavior through simple annotations or settings, and the mapper translates these into appropriate SQL queries automatically, providing control without requiring developers to write explicit queries.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7788275B2Customization of relationship traversal
Publication Date: 2010.08.31 MICROSOFT TECHNOLOGY LICENSING LLC
  • US7788275B2 patent drawing
  • US7788275B2 patent drawing
  • US7788275B2 patent drawing

AI summary

An object-relational mapping mechanism facilitates customized relationship traversal. The mechanism can override default loading behavior with custom functionality (e.g., eager loading, lazy loading . . . ) specified by a programmer, for example. In other words, the object-relational mapping mechanism includes an extensibility point or hook for customization.