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
Links to this post:
Create a Link
<< Home