# US 2021/0279041 A1 · Dynamic validation framework extension

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0279041 A1
- Document ID: US20210279041A1
- Status: Published application
- Kind: A1
- Application number: 16/809,025
- Filed: 2020-03-04
- Published: 2021-09-09
- Earliest claimed: 2020-03-04
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Pavel Bzoch
- Web page: https://patentgrep.com/patent/US20210279041A1

## CPC

- G06F 8/315: {Object-oriented languages}
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/24: {Object-oriented}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A programming language framework may be enhanced to provide for dynamic validation. Dynamic validation allows the validator function for any variable to be selected at runtime rather than statically declared at programming-time. Instead of annotating a variable with an annotation that refers to a specific validator function or constraint type, programmers can annotate a variable with an annotation that indicates that the validator function will be selected dynamically at runtime. When a runtime instance of the variable is created, the programming language framework may identify the dynamic validation annotation on the variable, and then use the runtime values in the variable to determine which validator function(s) should be used.

## Claims

### Claim 1

A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
receiving, at a programming language framework, an instance of an object, wherein a definition of the object is annotated with a constraint;
receiving, at the programming language framework, one or more validators that are annotated with an annotation that identifies:
an attribute in the definition of the object; and
a value for the attribute;
identifying, at the programming language framework, a validator in the one or more validators for which a value of the attribute in the instance of the object matches the value for the attribute in the annotation of the validator; and
executing the validator using the instance of the object.

### Claim 2 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the validator validates a value of a second attribute in the definition of the object.

### Claim 3 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the one or more validators comprises a second validator for which the value of the attribute in the instance of the object does not match the value for the attribute in the annotation of the second validator.

### Claim 4 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the constraint with which the definition of the object is annotated causes the programming language framework to use dynamic validation rather than static validation.

### Claim 5 (depends on 4)

The non-transitory computer-readable medium of claim 4, wherein the programming language framework comprises a definition for the constraint with which the definition of the object is annotated, wherein the definition for the constraint specifies that the constraint may be executed on object type targets.

### Claim 6 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the programming language framework comprises a definition for the annotation with which the one or more validators are annotated, wherein the definition comprises an attribute name and an attribute value pattern.

### Claim 7 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the programming language framework comprises a definition of an abstract class from which each of the one or more validators is inherited.

### Claim 8 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein the abstract class comprises an abstract function that determines if a constraint is valid for an object.

### Claim 9 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein the abstract class comprises a protected function that validates an object against custom constraints.

### Claim 10 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the programming language framework comprises a definition of a class that scans a class path and identifies each of the one or more validators in the class path.

### Claim 11 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the definition of the class includes a function that filters out ones of the one or more validators for which the value of the attribute in the instance of the object does not match the values for the attributes in the annotations of the ones of the one or more validators.

### Claim 12 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the programming language framework creates an instance based on the definition of the class as an entry point for dynamic validation when receiving the instance of the object.

### Claim 13 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the definition of the class first executes any static validations before executing any dynamic validations.

### Claim 14 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the instance of the object comprises the attribute and a second attribute.

### Claim 15 (depends on 14)

The non-transitory computer-readable medium of claim 14, wherein the attribute determines which of the one or more validators should be used to validate a value assigned to the second attribute.

### Claim 16 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the attribute comprises a key and the second attribute comprises a value in a key-value pair.

### Claim 17 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the key indicates a datatype of the value.

### Claim 18 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein:
the validator is annotated with a second annotation that identifies a second attribute in the definition of the object and a second value for the second attribute; and
a value of a second attribute in the instance of the object matches the second value for the second attribute in the second annotation of the validator.

### Claim 19

A system comprising:
one or more processors; and
one or more memory devices comprising instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
receiving, at a programming language framework, an instance of an object, wherein a definition of the object is annotated with a constraint;
receiving, at the programming language framework, one or more validators that are annotated with an annotation that identifies:
an attribute in the definition of the object; and
a value for the attribute;
identifying, at the programming language framework, a validator in the one or more validators for which a value of the attribute in the instance of the object matches the value for the attribute in the annotation of the validator; and
executing the validator using the instance of the object.

### Claim 20

A method of executing dynamic validation in programming language frameworks, the method comprising:
receiving, at a programming language framework, an instance of an object, wherein a definition of the object is annotated with a constraint;
receiving, at the programming language framework, one or more validators that are annotated with an annotation that identifies:
an attribute in the definition of the object; and
a value for the attribute;
identifying, at the programming language framework, a validator in the one or more validators for which a value of the attribute in the instance of the object matches the value for the attribute in the annotation of the validator; and
executing the validator using the instance of the object.
