# Validation



[Data extensions](/configuration/data-extensions/overview) can be defined using custom data types in addition to built-in types such as `string` and `int`.

Usage [#usage]

For example, rather than adding properties to an auto policy such as `driverName1`, `driverName2`, `driverLicense`, `driverLicense2`, and then having to guess how many of each of these you will need, you could do the following:

* First, create a custom data type called `Driver` by adding this to the configuration:

```json
{
    "dataTypes": {
        "Driver": {
            "data": {
                "firstName": { "type": "string" },
                "lastName": { "type": "string" },
                "licenseNumber": { "type": "string", "maxLength: 20" },
                "licenseState": { "type": "string", "maxLength": 2 }
            }
        }
    }
}
```

* Then, for your `policy` element (or any element) in the configuration for the auto product, declare a property that uses the type `Driver` in its extension data:

```json
{
    "products": {
        "personalAuto": {
            "data": [
                "drivers": { "type": "Driver+" }
            ],
            "contents": "vehicle+"
        }
    }
}
```

As shown in the example above, you may use [quantifiers](/configuration/general-topics/quantifiers) such as `+` with custom data types. This includes the automatic creation quantifier `!`, which should be used if you want an item of your custom type to be created automatically. The platform does not infer the intent for automatic creation, even if all the custom type's fields have default values.

Custom Data Inheritance [#custom-data-inheritance]

Custom data types can use inheritance, similar to how elements and accounts can use inheritance to keep related types simpler to manage. Common information is put in a base and the differences expressed with individual declarations.

For example, maybe you want to have two different types of people in your system, with the general "Person" having just names, but a "Driver" adding driver's license information. You could do that as follows:

First, declare the `Person` type:

```json
"Person": {
    "data": {
        "firstName": {
            "type": "string"
        },
        "lastName": {
            "type": "string"
        }
    }
}
```

And then extend `Person` with added properties in a `Driver`:

```json
"Driver": {
    "extends": "Person",
    "data": {
        "licenseNumber": {
            "type": "string",
            "maxLength: 20"
        },
        "licenseState": {
            "type": "string",
            "maxLength": 2
        }
    }
}
```

Inheritance can be many levels deep. You could extend `Driver` to manage a `CommercialDriver` type:

```json
"CommercialDriver": {
    "extends": "Driver",
    "data": {
        "stateQualificationExamDate": {
            "type":
            "date"
        },
    }
}
```

Each custom type will have its properties validated in the same way as for built-in types. Custom types are also available for inspection and validation using the Validation Plugin.
