Dec 28, 2004 / Java static and condition checking
0 comments
While reading Martin Fowler's book "Patterns of Enterprise Application Architecture ", found a good way to check input parameters. This is a kind of pre-condition checking in
Design By Contract methodology.
class PluginFactory...
private static Properties props = new Properties();
static {
try {
String propsFile = System.getProperty("plugins");
props.load(new FileInputStream(propsFile));
} catch (Exception ex) {
throw new ExceptionInInitializerError(ex);
}
}
0 Comments:
Post a Comment
<< Home