**Source URL:** https://general.veevavault.dev/regulatory/vault-sdk/developing-code/programming-guidelines.md

# Programming Guidelines

While developing Vault extensions is essentially programming in Java, there are some language and JDK restrictions to ensure your code runs securely in Vault.

You should observe the following general guidelines when developing Vault extensions:

* Only use interfaces provided by the Vault Java SDK

* Only use [allowlisted JDK](/vault-sdk/references/limits-restrictions/#JDK_Allowlist) classes and methods

* Make your code thread safe

* Validate your code often

* Understand and follow all [Vault limits and restrictions](/vault-sdk/references/limits-restrictions/)

* Only use `RollbackException` for [exception handling](/vault-sdk/references/limits-restrictions/#Exception_Handling_Restrictions)

## Collection Classes {#Collection_Classes}

Vault Java SDK does not allow instantiation of traditional Java collection classes to create maps, lists, or sets. Instead, you must use the methods provided by the `VaultCollections` interface. Once you create a collection, you can use all [allowlisted](/vault-sdk/references/limits-restrictions/#JDK_Allowlist) methods from the JDK `Map`, `List`, and `Set` interfaces.

### Code Validation {#code-validation}

Restrictions are checked during validation, which happens when you deploy code to Vault from a VPK. For example, if your code uses a third-party library or non-allowlisted class, it will not pass validation and deployment will fail. We recommend validating your code often during the development process to catch issues early.

You can do this with the [Validate Package endpoint](/vault-api/api-reference/26.1/configuration-migration/validate-package).

<Endpoint path="/api/{version}/services/package/actions/validate" method="POST"></Endpoint>
To use this endpoint, you must [create a Vault Package File (VPK)](/vault-sdk/deploying-code/create-vpk/) as input.

You can view, download, delete, enable or disable deployed extensions in the Admin UI, located in **Admin** > **Configuration** > **VAULT JAVA SDK**. Learn more about the [Admin UI in Vault Help](https://platform.veevavault.help/en/gr/45776).



---

**Previous:** [POM Setup](/regulatory/vault-sdk/developing-code/pom-setup)  
**Next:** [Deploying Code](/regulatory/vault-sdk/deploying-code)