Dec 28, 2004 / Java static and condition checking

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



TP v.2 online demo


© 2004-2007 TargetProcess. Agile project management software
info@targetprocess.com