Hi Oliver this is no abuse. It is simply the way to design things when you are on SE level. Testability is only then an issue, if the implementation is hardcoded, which is not the case, if you have a good SPI behind it! And last comparing static accessors with unnecessary dependencies the second one are worse!
Cheers, Anatole 2014-12-04 17:32 GMT+01:00 Oliver B. Fischer <[email protected]>: > I don't like the abuse of static methods. In one of the earlier discussion > I proposed > > new Configuration() > > Static methods are great for small helper methods. But they become > problematic if you would like to test code and to substitute their > funtionality with mocks. > > Best, > > Oliver > > Am 04.12.14 15:45, schrieb Werner Keil: > > Hi, >> >> Probably more important than config subsystems in JSR 107 or Log4J 2 >> (though it altogether got a really good rewrite making any effort for a >> "Logging JSR" by some people almost pointless;-) seems a massive redesign >> and recent activity of Apache Commons Logging 2: >> http://commons.apache.org/proper/commons-configuration/index.html >> >> Anybody had a look at that? >> >> Apache certainly has a very multicultural ecosystem, look at Struts vs. >> OpenFaces vs. Wicket vs. Tapestry and who knows how many (Web MVC) >> projects >> all exist, so why not have at least 2 or 3 for configuration. >> >> Something noteworthy is, that Commons Configuration 2 refrains from any >> static factory. >> Even a class sounding like it was static such as Configurations (in a new >> "fluent" package) works like this: >> Configurations configurations = new Configurations(); >> PropertiesConfiguration config = configurations.properties(new File( >> "config.properties")); >> >> Werner >> >> > -- > N Oliver B. Fischer > A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany > P +49 30 44793251 > M +49 178 7903538 > E [email protected] > S oliver.b.fischer > J [email protected] > X http://xing.to/obf > > -- *Anatole Tresch* Java Engineer & Architect, JSR Spec Lead Glärnischweg 10 CH - 8620 Wetzikon *Switzerland, Europe Zurich, GMT+1* *Twitter: @atsticks* *Blogs: **http://javaremarkables.blogspot.ch/ <http://javaremarkables.blogspot.ch/>* *Google: atsticksMobile +41-76 344 62 79*
