Skip to Content
Software Architecture Design Patterns in Java
book

Software Architecture Design Patterns in Java

by Partha Kuchana
April 2004
Intermediate to advanced
520 pages
10h 10m
English
Auerbach Publications
Content preview from Software Architecture Design Patterns in Java

28 EXPLICIT OBJECT RELEASE

DESCRIPTION

In general, an object may need to deal with external resources such as files, databases and network connections as part of its implementation to provide the services it is designed for. The Explicit Object Release pattern suggests that when such an object is no longer needed, the external resources tied up with the object should be released explicitly, in a timely manner.

The Java programming language provides the following two ways to design the mechanism to release external resources explicitly:

  • The finalize() method
  • The finally statement

The finalize Method

Some object-oriented programming languages require a programmer to explicitly destroy objects when they are no longer needed. In the Java programming ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Java

Hands-On Software Architecture with Java

Giuseppe Bonocore

Publisher Resources

ISBN: 9780203496213