> -----Original Message----- > From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 27, 2001 4:43 PM > > On 11/27/01 10:34 AM, "Paulo Gaspar" <[EMAIL PROTECTED]> wrote: > > > ... > > There is also a bit of talk currently in commons about putting together a > validation framework...
Yes, I am following that. I downloaded the mapper (http://husted.com/struts/resources/mapper.zip) mentioned in one of the postings and (form the little I already red) I am finding it quite interesting. I am following a similar but simpler approach and I also think that Validation is naturally associated with Conversion and Mapping, where Mapping is just associating values with names and mapping sets of named values into other sets of named values. In my case most of my stuff revolves around a couple of "Mapper" interfaces (much simpler than a Map) that map values to names, because I found out (this one was not very hard (o;= ) that we spend most of the time mapping values to names, in forms, beans, database ResultSets, template contexts, etc. and then passing those named values between these types of objects. Then I have a Record, which is a "Mapper" with a well defined set of typed values (so, it adds type information). And then I have a Converter, composed of small class A to class B conversion rules. Then, I can associate a default converter to my basic Record object. When you assign an Object to a record's field, it just uses its converter to try converting the assigned object into an object of its defined type. Some validation is already performed during the conversion (is this string parsable into a date?) but more sophisticated validation is missing. Then there is an utility class with methods to pass values from one Mapper to another by name, which includes things like passing values from HTTP parameters to a record by name - assuming that the names are the same and optionally ignoring case. This takes care of converting (and will take care of validating) those values. I still miss some more formatting and validation sophistication but it works quite well. I still completely miss having a Mapping (map this names from A into those names from B) but that is basically adding a name-to-name map to the utility routines that pass values among "Mappers". I am building the form stuff on top of this. Well, I am building a load of stuff on top of this, which already includes bean introspection for my XML configuration system and things like that. At the moment I am even converting the DbCursor I once told you about into a DbIterator also based on this stuff. > > ... > > So where can we find this? ;-> Man, I am managing some >60,000 lines of code at the moment and this kind of code volume takes some time to tame. You write it or you grab-and-adapt from somewhere else (which in my case includes a load of Jakarta stuff) and then you have to tame it. It takes time. Always more time than I expect. And the forms are something I am just starting and doing in between other higher priorities. Basically, I just have a clear idea and some prototyping code. So, I don't even know when I will make it 1st priority, much less when it will be done. And then I do not know if I can offer it, I have to check that. BTW, I am more interested in offering a Database Connection Pool, if you know some Open Source project that wants one. =;o) PoolMan did too much (caching and other) and not enough (pool behavior and other) at the same time. DBCP had no good "Resource Management" (closing depending Statements+ResultSets when you close the Connection handle) and I spent the last week messing around with such beast. But I started testing 2 or 3 days ago and only tuned it for performance yesterday. So, everything in my hands now is very very new. > -- > Geir Magnusson Jr. [EMAIL PROTECTED] Have fun, Paulo Gaspar http://www.krankikom.de http://www.ruhronline.de -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
