http://xkcd.com/754/ On Tue, Jun 29, 2010 at 11:37 AM, Matt Grimm <matt.t.gr...@gmail.com> wrote:
> What is the conventional wisdom (if any) for handling conditional > dependencies in modules? > > For example, I have a logger class wrapped around Log4perl that > supports screen, email, and syslog appenders, and each appender can be > individually toggled on or off. Is it better to force the dependencies > on the underlying syslog and email modules at the top of the logger > class, or is it acceptable to bury those imports in the methods that > actually do the initialization of each appender? It sort of comes down > to whether I want the issue detected at compile time or run time I > suppose, but is generally frowned upon to put imports down inside > class methods? > > Thanks for any insight. > > m. > -- Check out my LEGO blog at http://www.brickpile.com/ View my photos at http://flickr.com/photos/billward/ Follow me at http://twitter.com/williamward