# Deferred evaluation

Resolving or computing a value only when the information needed to produce it is available.

Also known as: lazy evaluation, deferred resolution

Some resource values do not exist when the application model is first constructed. Ports, endpoints, generated credentials, or provisioned cloud outputs may become available later.

Value providers and structured expressions defer resolution until the appropriate stage. In run mode that may produce a concrete value; in publish mode the target may receive an expression to resolve during deployment.

Preserving a reference avoids hard-coding a development value into output intended for another environment.

## Practical example

Resolve a service's allocated port after endpoint allocation rather than trying to read it while the AppHost is still declaring resources.

## Learn more

- [Understand how resource values are resolved](https://aspire.dev/architecture/resource-hierarchies/)

## Related terms

- [Environment variable](https://aspire.dev/hub/glossary/environment-variable/)

- [Hoisting](https://aspire.dev/hub/glossary/hoisting/)

- [ReferenceExpression](https://aspire.dev/hub/glossary/referenceexpression/)