These are objects that "sit apart" from the main part of the code and do part of the work for the object. They "help" the object do the work.
For example, many people have a Closer helper object. This will take various lockable objects, for example, java.sql.Statement, java.sql.Connection, etc., and will close the object and ignore any errors that come out of it. This is because if you get an error while closing the object, there is nothing you can do about it, so people just ignore it.
Instead of having this template:
try { connection.close(); } catch (SQLException e) {
scattered around the code base, they simply call:
Closer.close(connection);
instead. For example, look at guava closeQuietly .
Paul Wagland Jan 25 '10 at 9:28 a.m. 2010-01-25 21:28
source share