Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Read the whole "Validation with Java and XML Schema" series:
In an effort to resolve that problem, at least until the powers that be come up with a robust API for validation, this series takes a detailed look at validation in Java. That isn't an explanation on using JavaScript in your HTML or expensive third-party libraries but instead on creating a simple validation framework based on existing standards. The focus is on ease of use and a simple means to add new validation rules into the data constraints without cluttering business and presentation logic with validation details.
To get started, you should take the time to read Part 1 in the series. In that article, I looked at several existing options for validation, particularly pure Java options. Both
inline validation (such as directly in a servlet or Enterprise JavaBean) as well as helper classes (such as Jason Hunter's
ParameterParser class) often still resulted in code that was cluttered and that mixed validation with business and application logic. Additionally,
you were left to deal with numerous try/catch blocks and throwing exceptions. It also left the unwanted problem of having to constantly recompile, even for the most minor
changes in data constraints (such as changing an allowed range from between 0 and 20 to between 1 and 20).
I also discussed Java property files as a way to handle that problem. First, a small clarification: while Java does allow property files to have multiple period separated keys (key1.key2.key3 = value), it does not allow their use in any meaningful way. For example:
ldap.hostname = galadriel.middleearth.com ldap.port = 389 ldap.userDN = cn=Directory Manager ldap.password = foobar
It would seem that that sample entry in a Java properties file represents a logical grouping; all the entries start with the
ldap key. However, that is not the case with standard Java APIs. That entry set is functionally equivalent to:
hostname = galadriel.middleearth.com port = 389 userDN = cn=Directory Manager password = foobar
In other words, there is no means to get, for example, all the keys with an ldap root. That makes using multiple-key values useful for human readability only and essentially a waste of time in actual application
programming without custom or third-party libraries. So Java property files, too, are not suitable for large validation rules.