Singleton or DRY
===

Suppose you have a system that interacts with a database.  Because the system uses the database so heavily, nearly every subroutine follows this pattern:

    foo(database, rest, of, arguments)

That's noticed fairly quickly, and since foo is part of a larger object, the connection variable is moved to an object variable.  Unfortunately, that means the constructor for every model object takes this argument.

So you decide to create a module that can generate a connection to the database.  Since connections to the database are expensive, the connection is cached and that cached value is returned on future calls.

What you've just created is a singleton.  This is a pattern that generally frowned upon in the development community.  Then again, DRY is a principle that is encouraged, even more so than the singleton pattern is discouraged.

So which is better?  Your options are inflating the number of arguments going into every function call (or at least the constructors), or creating a singleton.  Is there a third option I'm not seeing?