2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
title: Resource Acquisition Is Initialization
|
2021-09-12 13:27:23 +03:00
|
|
|
category: Idiom
|
2021-05-19 10:49:05 -06:00
|
|
|
language: en
|
2015-12-28 15:52:44 +02:00
|
|
|
tags:
|
2019-12-13 21:09:28 +02:00
|
|
|
- Data access
|
2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Intent
|
|
|
|
Resource Acquisition Is Initialization pattern can be used to implement exception safe resource management.
|
2015-08-13 23:54:40 +02:00
|
|
|
|
2019-12-07 20:01:13 +02:00
|
|
|
## Class diagram
|
2015-08-13 23:54:40 +02:00
|
|
|

|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Applicability
|
|
|
|
Use the Resource Acquisition Is Initialization pattern when
|
2015-08-13 23:54:40 +02:00
|
|
|
|
2019-12-13 21:09:28 +02:00
|
|
|
* You have resources that must be closed in every condition
|