Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. So tired of programming the same crap

So tired of programming the same crap

Scheduled Pinned Locked Moved The Lounge
csharp
24 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Vasily Tserekh

    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 :((

    B Offline
    B Offline
    BrainiacV
    wrote on last edited by
    #21

    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.

    1 Reply Last reply
    0
    • V Vasily Tserekh

      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 :((

      T Offline
      T Offline
      trooper0814
      wrote on last edited by
      #22

      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.

      1 Reply Last reply
      0
      • V Vasily Tserekh

        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 :((

        R Offline
        R Offline
        RafagaX
        wrote on last edited by
        #23

        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...

        1 Reply Last reply
        0
        • S Sentenryu

          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)

          C Offline
          C Offline
          Chad3F
          wrote on last edited by
          #24

          Reminds me of one of the old Space Quest games where a shop in the game had a copy of SimSim, the ultimate simulator simulator. :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups