So tired of programming the same crap
-
yes the usual C# form collecting data and validate if the user inputed all the fields and that the data is correct, pleeease I am about to build a validation framework :((
Why don't you do what I do? Look down at the code from Olympian heights and then to discern the patterns that exist in your fields? I once took a system that had 25 fields I had to validate and decided that for 22 of them they only differences were if they were numeric or alpha, allowed truncation or not, and then I wrote a single Macro (this being back in the days of S/370 Assembler) that would generate the code for the 22, leaving only 3 I had to write custom code for. Another time I took a 15 page flowchart my manager had given me to implement and reduced it to 1 page by pushing all the custom parameters out to a database. This really helped a lot because I was able to code a default behavior that the program would use if it couldn't find the special conditions it was looking for. Instead of crashing and burning, requiring an all hands, this has got to be fixed yesterday response, I was able to add new records to the database that fixed it, weeks after the problem cropped up (because I didn't discover the problem was occurring for those weeks since it did not halt and catch fire.) It sounds like you've written this code a few times so you show be able to factor the behavior. I took multiple conveyor designs and finally distilled them down to a single system that was table driven that could handle any number of diverters, any types of diverters, and an infinite geometry, leaving only the accounting side to be custom coded. I assumed after doing enough accounting systems I'd finally be able to factor that as well. Currently I'm doing web screens where the fields are all defined in a database table and the screen is dynamically built on demand. Adding fields used to take days because there were multiple screens (a design that preceded me) that needed to be modified. Now it can be done in about 15 minutes (with testing). Come on, you're supposed to be a programmer - a hard working lazy person who never wants to do the same thing twice.
Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.
-
yes the usual C# form collecting data and validate if the user inputed all the fields and that the data is correct, pleeease I am about to build a validation framework :((
Try out http://rulesengine.codeplex.com/[^]. I liked it. :cool: Rules Engine is a . NET C# project that validates business logic by defining a bunch of rules for your data classes. Rules are defined using a fluent-interface (fluent validation) helper class, and not by decorating your existing objects with attributes, therefore de-coupling validation logic from data (or domain) classes.
-
yes the usual C# form collecting data and validate if the user inputed all the fields and that the data is correct, pleeease I am about to build a validation framework :((
Once i though of doing some classes for this same purpose, but for PHP, and the approach i was thinking to use was the same Marc Clifton used, it's an interesting approach and you must do it just once, if you need a change, you just tweak it for newer/changing fields. Then if you have a good heart, open source it with a MIT license and put on CodePlex. ;)
CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...
-
Please, don't. i had enough of frameworks by here, there's even a framework to create frameworks :sigh:
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)