In the past few days, the veils obstructing a couple rules-of-thumb have slowly melted away:
1. Don't use model objects as form backing objects. Use simple value objects instead. This adds an extra layer, but eliminates complications. This is especially true in Spring WebFlow (2.0.7) which does not instrument the "open session in view" pattern, unlike Spring MVC which odes.
2. Make sure your value object fields are Strings as much as possible. If a field represents a number, you can convert it later. Doing this avoids the need to configure pretty binding error messages for the user, when, for example, the user enters characters into a form field which binds to an Integer field in the value object.
Added (2-19-2010): More generally, if you are discontinuing the use of a database column that has been in existence for a long time, do not delete the column, because removing all mentions of that column from all the code can prove to be quite hairy.
Wednesday, January 13, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment