Paulo Gaspar wrote: > For such use it makes sense to have a specialized DynaClass and some > helpers,
Agreed. I'm just thinking that the first thing I will do with a DynaBean is define a number of standard field or column helpers, that would correlate to the columns or fields in a database. Since this will be a common idea, we might want to consider a companion package to the DynaBean that defined these helpers. This could save us, and dozens of others, from each implementing our own, all with the same goals. There are are finite number of column types supported by the JDBC, so I'm thinking there could be a toolkit for generating these and rolling them into a DynaBean. Since any value can be represented as a String, such a helper might include a String buffer along with its native object, and could be very useful in ferrying input from the Web tier (which is String based) to the Business tier (which often needs native values). So each column helper would have a getXXX form and a getXXXString form. There may also be a setXXXBuffer form to enter data for later validation, and then a trigger for the valiation/conversion routine. Elsewhere in this thread, I believe it's been suggested that an application might actually end up with two DynaBean definations, one String, one native. This often happens in Struts applications today. I'm just thinking that the leverage a DynaBean give us, makes a standard column helper package is an attractive idea. In practice, there would probably be domain-level validators/converters in the column helpers, and a model-level validator/convereter in the DynaBean itself. The idea being, for example, that first I make sure the datum could be a username or password (not too short, et cetera), and then I check to see if it actually registered as such. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
