IP Library Granted Patent US 9,606,783
Granted Patent B2
US 9,606,783 · App. 14/052,799 · Granted Mar 28, 2017

Dynamic code selection based on data policies

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,606,783
App. No.
14/052,799
Granted
Mar 28, 2017
Kind
B2
Abstract

In a method for dynamically replacing code within a software application on a device, an annotated code segment that performs a function according to a first data policy is received. The computer determines an alternate segment that performs the function according to a second data policy.

Claims (72)

1. A method for dynamically replacing code within a software application on a device, the method comprising:

a computer receiving an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein:

the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;

each respective data policy includes a set of requirements associated with the respective data policy;

the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; and

the annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;

the computer determining an alternate code segment that performs the function according to the second data policy, wherein:

the alternate code segment is stored in a repository external from code of the software application; and

the repository contains source code for performing the function according to various data policies;

the computer causing a compiler to compile the alternate code segment;

subsequent to the computer determining the alternate code segment, the computer storing the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;

the computer determining that the device is set to utilize the second data policy; and

the computer substituting the annotated code segment with the compiled alternate code segment.

2. The method of claim 1 , wherein the first and second data policies are energy policies for data.

3. The method of claim 1 , wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy.

4. The method of claim 1 , further comprising:

the computer causing the software application to execute using the compiled alternate code segment.

5. The method of claim 1 , wherein the computer determining the alternate code segment that performs the function according to the second data policy comprises:

the computer identifying the alternate code segment that performs the function according to the second data policy from the repository based on, at least, the second tag.

6. The method of claim 1 , further comprising:

the computer determining that the alternate code segment provides a different external interface than the annotated code segment;

the computer generating a prompt for an interface mapper, wherein the interface mapper is capable of bridging from a first interface of the annotated code segment to a second interface of the alternate code segment;

the computer receiving the interface mapper.

7. The method of claim 1 , wherein the computer receiving the annotated code segment of the software application of the device that performs the function according to the first data policy comprises:

the computer comparing performance of the software application during runtime on the device to each set of requirements associated with each of a plurality of data policies, including, at least, the first data policy;

the computer receiving the annotated code segment; and

the computer determining that the annotated code segment performs the function according to the first data policy based on the comparison of the performance of the software during runtime to the set of requirements associated with the first data policy.

8. The method of claim 1 , wherein the computer determining an alternate code segment that performs the function according to a second data policy comprises:

the computer determining that no code segment performs the function according to rules of the second data policy; and

the computer determining that the alternate code segment performs the function more closely aligned to the rules associated with the second data policy, as compared to the annotated code segment.

9. The method of claim 1 , wherein:

the computer storing the compiled alternate code segment and the second tag comprises the computer storing the compiled alternate code segment to a repository prior to the computer determining that the device is set to utilize the second data policy; and

the computer substituting the annotated code segment with the compiled alternate code segment comprises:

retrieving the compiled alternate code segment from the repository; and

substituting the annotated code segment with the compiled alternate code segment.

10. The method of claim 1 , wherein the computer comprises an annotation processor, and the annotation processor is operative to process annotations and modify code.

11. A computer program product for dynamically replacing code within a software application on a device, the computer program product comprising:

one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:

program instructions to receive an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein:

the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;

each respective data policy includes a set of requirements associated with the respective data policy;

the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; and

the annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;

program instructions to determine an alternate code segment that performs the function according to the second data policy, wherein:

the alternate code segment is stored in a repository external from code of the software application; and

the repository contains source code for performing the function according to various data policies;

program instructions to cause a compiler to compile the alternate code segment;

program instructions to, subsequent to determining the alternate code segment, store the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;

program instructions to determine that the device is set to utilize the second data policy; and

program instructions to substitute the annotated code segment with the compiled alternate code segment.

12. The computer program product of claim 11 , wherein the first and second data policies are energy policies for data.

13. The computer program product of claim 11 , wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy.

14. The computer program product of claim 11 , further comprising:

program instructions to cause the software application to execute using the compiled alternate code segment.

15. A computer system for dynamically replacing code within a software application on a device, the computer system comprising:

one or more computer processors, one or more computer-readable storage media, and program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising:

program instructions to receive an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein:

the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device;

each respective data policy includes a set of requirements associated with the respective data policy;

the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; and

the annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy;

program instructions to determine an alternate code segment that performs the function according to the second data policy, wherein:

the alternate code segment is stored in a repository external from code of the software application; and

the repository contains source code for performing the function according to various data policies;

program instructions to cause a compiler to compile the alternate code segment;

program instructions to, subsequent to determining the alternate code segment, store the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy;

program instructions to determine that the device is set to utilize the second data policy; and

program instructions to substitute the annotated code segment with the compiled alternate code segment.

16. The computer system of claim 15 , wherein the first and second data policies are energy policies for data.

17. The computer system of claim 15 , wherein the annotated code segment includes a data structure class, wherein properties of the data structure class associate the data structure class with the first data policy.

18. The computer system of claim 15 , further comprising:

program instructions to cause the software application to execute using the compiled alternate code segment.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: KYNDRYL, INC.
Reel/Frame 057885/0644 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 14, 2013
From: BALASUBRAMANIAN, SWAMINATHAN; DE, RADHA M.; O'CONNELL, BRIAN M.; VASUDEVAN, CHERANELLORE
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 031396/0771 →