|
From: Keith D. <kd...@cs...> - 2004-03-03 20:14:26
|
Seth and I have similar but slightly different efforts ongoing between = us. So it would silly for me to commit stuff that looks like his but not = quite. Personally I'd like one solution that works in both web and rcp = environments equally well. There are a few differences in the Seth's design that may be issues for = me: 1. Seth's ValidationRule interface validate values on an object's = existing property values. My ValidationRule interface can validate existing or proposed property values. This allows you to validate a property value before it is set on a domain object, which is important for me. For example, Seth's validationRule interface looks like public boolean validate(Object object, Object field); <mine looks like> public boolean validate(Object object, Object value); The interfaces mean two different things conceptually. My "MandatoryPropertyValidationRule" just looks at the value to enforce the not-null and not-empty constraint. Other, more complex, rules might use = the object as a context to evaluate a proposed value (for example, a = proposed value must be > then some existing value on the domain object.) 2. Our ways of collecting results are a bit different. I have ValidationResultsCollector interface, and Seth uses the Errors = interface. Not a big deal, but the ValidationResultsCollector provides some = additional callbacks for tracking validation progress (starting, ending, etc.) = which I use to update a panel on a rich-client form. 3. I provide a programmatic interface for creating a BeanValidator which encapsulates one or more PropertyValidators which encapsulate one or = more PropertyValidationRules. Granted, with attributes you probably don't = need this all the time, but it's still nice to have. 4. You retrieve an instance of the appropriate BeanValidator for a = domain object by using the ValidatorRegistry, which indexes validators by = domain object type. Seth, one question I have is how do you bind a AttributeValidator instance to the correct domain object? 5. My rules encapsulate the message creation logic as well as 'typing = hint' creation logic since they own errorCode and rule messageArguments data, = but that's just a minor thing. I definitely think declarative validation based on attributes is a good addition. Seth's stuff looks great, I guess I'd just like to be able to = use it in a RCP environment equally well; and I was just about to commit my stuff to the sandbox, too... Thanks, Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Alef Arendsen Sent: Wednesday, March 03, 2004 1:43 PM To: spr...@li... Subject: RE: [Springframework-developer] Request for Sandbox Inclusion +1 I think validation based on attributes is a good addition to Spring. Alef > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On > Behalf Of Seth Ladd > Sent: Wednesday, March 03, 2004 7:17 PM > To: spr...@li... > Subject: [Springframework-developer] Request for Sandbox Inclusion >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Hello, >=20 > Forgive me if I'm going at this the wrong way. Please let me know if > there is another process I should follow. >=20 > I'd like to request that the Attribute Validator be included in the > Sandbox. I'd like to continue work on it in a more public setting. =20 > Our resources here at work aren't set up for hosting a public project. = > Also, it's my hope that the Attribute Validator will become a=20 > supported option for validation in the spring framework (after much=20 > testing!). >=20 > I believe others would find this project useful. I will continue to > develop this library, as it has become core to our internal project. >=20 > Please let me know what other steps I should take before we could move > it into the public sandbox. >=20 > Thanks very much, and thanks for Spring! > Seth > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >=20 > iD8DBQFARiEZ5EIB1scRes8RAkjRAJ0QWDCs/lhLXq8yZZpjKRoNVx3nUACdGUcb > 3jCeT/hBEMOXGcL9ri+H274=3D > =3DVrTA > -----END PGP SIGNATURE----- >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and > deploy apps & Web services for Linux with a free DVD software kit from = > IBM. Click Now! = http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |