So tired of programming the same crap
-
Don't do that, please! Use the factory pattern instead.
AbstractFrameworkFactory.Create(new FrameworkFactoryCreatorFactory>());
My Messianic Jewish blog: Kineti L'Tziyon My software blog: Debugger.Break() Judah Himango
Judah Himango wrote:
AbstractFrameworkFactory<FrameworkFactory>.Create(new FrameworkFactoryCreatorFactory<Framework<Factory>>());
My Messianic Jewish blog: Kineti L'Tziyon My software blog: Debugger.Break() Judah Himango
-
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 :((
We all know where you are coming from. I wish that I had someone who I could delegate to perform the ad nausea ad tedium. ...but I don't. ...but if I did, then I would feel a bit guilty as well... Coding is so much fun, but it is spoilt by a lot of mundane and tedious tasks, that my dog could do equally well. Either automate it or... Just do it...Write a frameWORK... Post it on CP and you could be a hero. or Sell it to all of us and be hero like. Support it and be back to the same old mundane stuff. Lifes a beach and as the old saying goes "It wasn't meant to be easy" God I hate saying that.. Generally I find that the annoyance of the mundane is over shadowed by the interesting bits.
-
“Oh, you hate your job? Why didn't you say so? There's a support group for that. It's called EVERYBODY, and they meet at the bar.” Drew Carey. Every day job I've had that was new and exciting at one point always ended up being just the boring old day job later on. The annoyances may change but always show up eventually. The only exception I ever found was working for my self. I should really give that another try :-D
Play my game Gravity: IOS[^], Android[^], Windows Phone 7[^]
-
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)
They say that one key benefit of OOP is code reuse. Should work for you too. Won't it be a refreshing experience to carefully craft that dream framework for data validation and all possible extra tools to make it integrable in a snap of the fingers ?
-
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 :((
Another approach is the philanthropic one: on every single keypress on your keyboard when you code, think of the benefit of this data validation for your end-users, possibly sparing them hours of perplexity/frustration in front of unexpected results or program crash. Also think of the smart, informative, helpful and humorous error messages you can design. And all of this in a totally gratuitous spirit. Don't code for yourself, code for them.
-
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 :((
Vasily Tserekh wrote:
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 :((
Vasily, That's just one of the mundane parts of the job. Every job has some repetitive aspect to it. Try to make it cool by figuring out ways to boilerplate the process. Your validation framework is one idea. Over the years I've just used it as a challenge to figure out more efficient ways to go about it. It can still be fun if you try. -cb
-
Another approach is the philanthropic one: on every single keypress on your keyboard when you code, think of the benefit of this data validation for your end-users, possibly sparing them hours of perplexity/frustration in front of unexpected results or program crash. Also think of the smart, informative, helpful and humorous error messages you can design. And all of this in a totally gratuitous spirit. Don't code for yourself, code for them.
YvesDaoust wrote:
Another approach is the philanthropic one: on every single keypress on your keyboard when you code, think of the benefit of this data validation for your end-users, possibly sparing them hours of perplexity/frustration in front of unexpected results or program crash. Also think of the smart, informative, helpful and humorous error messages you can design. And all of this in a totally gratuitous spirit. Don't code for yourself, code for them.
I really like the way you put that! That's exactly the way I look at it when I'm coding up yet ANOTHER field validation event. My main coding is to a rules engine that builds employee time cards. I just remind myself that several million employees get a paycheck as a result of my work and it stays cool, even when it might otherwise be a bore. -CB :)
-
YvesDaoust wrote:
Another approach is the philanthropic one: on every single keypress on your keyboard when you code, think of the benefit of this data validation for your end-users, possibly sparing them hours of perplexity/frustration in front of unexpected results or program crash. Also think of the smart, informative, helpful and humorous error messages you can design. And all of this in a totally gratuitous spirit. Don't code for yourself, code for them.
I really like the way you put that! That's exactly the way I look at it when I'm coding up yet ANOTHER field validation event. My main coding is to a rules engine that builds employee time cards. I just remind myself that several million employees get a paycheck as a result of my work and it stays cool, even when it might otherwise be a bore. -CB :)
:thumbsup:
-
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)