IOC - Should util classes with static helper methods be wired up with IOC?

Posted by Greg on Stack Overflow See other posts from Stack Overflow or by Greg
Published on 2010-03-26T20:46:11Z Indexed on 2010/03/26 21:13 UTC
Read the original article Hit count: 309

Hi,

Just trying to still get my head around IOC principles.

Q1: Static Methods - Should util classes with static helper methods be wired up with IOC?

For example if I have a HttpUtils class with a number of static methods, should I be trying to pass it to other business logic classes via IOC?

Follow on questions for this might be:

Q2: Singletons - What about things like logging where you may typically get access to it via a Logger.getInstance() type call. Would you normally leave this as is, and NOT use IOC for injecting the logger into business classes that need it?

Q3: Static Classes - I haven't really used this concept, but are there any guidelines for how you'd typically handle this if you were moving to an IOC based approach.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about ioc-container

Related posts about ioc