Loan pattern

The Loan pattern ensures that a resource is deterministically disposed of once it goes out of scope. A resource could be one of a database connection, file, socket, or any object that handles a native resource (memory, system handles, connections of any type). This is similar in intent to the Dispose Pattern described on MSDN.

Get Design Patterns and Best Practices in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.