Metadata Fingerprinting for Selective Code Regeneration

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In code-behind models, regenerating automatically-generated code can be inefficient due to the need to recompile all code whenever source code changes, even if only minor changes occur, leading to unnecessary resource expenditure.

Innovation Solution

Implementing a fingerprinting system that focuses on metadata changes within binary files, allowing for finer-grained control of code regeneration by comparing metadata-fingerprints to determine if code-behind files need to be regenerated, rather than relying solely on file timestamps.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all automatically-generated code is regenerated whenever source code changes, then code consistency is maintained, but unnecessary resource expenditure occurs

Engineering Contradiction:
Improvecode consistencyVSAvoidresource expenditure
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent segments the code generation process by dividing code files into different types (automatically-generated vs. developer-authored) and applying different regeneration strategies to each segment. This allows selective regeneration of only the necessary portions rather than regenerating all code, thereby maintaining code consistency while reducing unnecessary resource expenditure.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the parameter used for regeneration determination from a blanket timestamp-based approach to a more refined metadata-based approach. By examining specific metadata (such as interface definitions, class definitions, and method signatures) rather than simply checking file modification times, the system can accurately determine whether code regeneration is truly necessary, thus reducing unnecessary resource consumption while maintaining consistency.

Inventive Principle:
Principle #35Parameter changes

2Ease of manufacture

If file timestamps are used to determine code regeneration, then implementation is simple, but control granularity is insufficient

Engineering Contradiction:
Improveimplementation simplicityVSAvoidcontrol granularity
Core Design Contradiction:
Ease of manufactureVSManufacturing precision

Solution Approach 1:

The patent segments the metadata into specific categories (interface definitions, class definitions, method signatures, field definitions) that are relevant to code generation. By analyzing changes in these specific metadata segments rather than treating all file changes uniformly, the system achieves fine-grained control over when code regeneration is necessary, improving precision while maintaining reasonable implementation complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces metadata as an intermediary layer between the source code and the code generation process. Instead of directly comparing source code files or using simple timestamps, the system uses metadata (which captures the essential structural information) as a mediator to determine whether regeneration is needed. This intermediary approach provides the desired control granularity without excessive implementation complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Manufacturing precision

If metadata inspection is performed to determine code regeneration, then control precision is improved, but processing complexity increases

Engineering Contradiction:
Improvecontrol precisionVSAvoidprocessing complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent extracts only the specific metadata elements that are relevant to code generation (interface definitions, class definitions, method signatures, field definitions) from the complete binary file metadata. By taking out and analyzing only these essential portions rather than processing all metadata, the system achieves high control precision while limiting the increase in processing complexity to only the necessary metadata subsets.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies different levels of inspection depth to different types of metadata based on their relevance to code generation. Critical metadata elements (such as interface and class definitions) receive thorough inspection, while less critical elements receive lighter inspection. This local quality approach optimizes the balance between control precision and processing complexity by allocating computational resources according to the actual importance of each metadata element.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS9031922B2Code regeneration determination from selected metadata fingerprints
Publication Date: 2015.05.12 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9031922B2 patent drawing
  • US9031922B2 patent drawing
  • US9031922B2 patent drawing

AI summary

A fingerprint is computed from selected metadata of binary files, and used in determining whether to regenerate code-behind file(s). In one case, after ascertaining that a binary-file-set's current metadata-fingerprint differs from a previous metadata-fingerprint, the corresponding code-behind-file-set is regenerated. A code-behind file may also be regenerated, even though its current fingerprint matches its previous fingerprint, because its metadata has changed. If the current fingerprint matches the previous fingerprint and metadata is unchanged, regeneration can be avoided. The fingerprint may consist of, or merely contain, definitions of classes, properties, and other items, and may be limited to metadata that is used when generating the code-behind-file-set. System assemblies are not fingerprinted. Timestamps may be used. Metadata-fingerprint computation code and regeneration determination code are described. Metadata-fingerprints may be used in developing applications with web-based application code frameworks, frameworks having code for rendering a user interface, other frameworks, XAML, C#, and other programming languages.