• Hanzito (unregistered)

    The team that wrote this must be in some sort of competition with the team that has to use it.

  • (nodebb)

    OK they tried the cheap contractor approach, the in house development approach, and both times the result was dismal. The only remaining option to try is to hire the HIGHLY PAID CONSULTANTS. Those always deliver great quality, don't they? 🤣🤣🤣

  • (nodebb)

    Could be worse. At least they use parameterized queries ^^

  • LZ79LRU (unregistered)

    I'd bet my monthly wage that the input isn't even sanitized and they are just copy pasting strings from the UI.

  • charles (unregistered)

    Have mercy! That list of db columns includes the dread "comments" field, always a tell that this table will contain at least one column of Mush. Many if not most of those other strings could be primary keys. They must have some idea of how this works, since I see "person_id", "node_id", and "problem_id", in there. So why is there a "customerName", and "escalationsName" in there? And for God's sake, who is the "fiddler"????

    But hey, at least it's (almost) alphabetized.

  • (nodebb) in reply to charles

    And for God's sake, who is the "fiddler"????

    One of my coworkers.

  • (nodebb)

    For those too lazy to otherwise count, that looks to me like it is a database table with at least 84 columns.

    I've never heard of anything of that scale where there wasn't a better design with more tables and less denormalization.

  • Chris (unregistered)

    By far the scariest thing I saw is the field name SQL_STATEMENT_INCLUDED, who knows what Lovecraftian horrors lurk behind that. Reminds me of a system I became the primary sufferer of a long while back where users could enter raw SQL that would get executed verbatim whenever the record was updated, essentially built in SQL injection attack in a handy text box.

  • Sole Purpose Of Visit (unregistered) in reply to dkf

    That was actually my first thought, not being a DB guy. Surely there is some sort of functional grouping that can be modelled in the schema? In which case you only need a primary and foreign key, and you can actually use sane parameterised queries. Or, I suppose, you could use an ORM, which is clearly a very difficult concept.

    Second thought was, as usual, the offshore guys are charging by LOC.

    Third thought was that this looks very much like something you can buy off the shelf. Which leads me to believe, per TA, that this company is actually the HPCs to which he refers.

  • Mike (unregistered)

    eventlogs? memorydump??

  • (nodebb) in reply to Mike

    It's some sort of dump, all right - a nasty messy smelly one, and there's no bogroll to wipe up the aftermath of this one...

  • Gearhead (unregistered)

    eventlogs? memorydump??

    webex?

  • (nodebb)

    I dunno what's consider a gold standard these days with Java, but seeing SQL strings just makes me puke.

  • löchlein deluxe (unregistered)
    Comment held for moderation.
  • LZ79LRU (unregistered) in reply to charles

    To be fair "comments" can literally be just that. As in it could be a comment or miscellaneous message about the entry left by the person or software producing it. In which case it can be your favorite field in the table because it gives you useful information in a human readable format at a glance.

  • Prime Mover (unregistered)

    I suspect that the database structure and design of accessors is a legacy of the original design.

    It may be reasonable to believe that there were aspects of the refactoring / rewrite where they may have considered this part of the app too gnarly to attack and left it till later, when they had tidied up and rationalized some of the lower-hanging fruit, but then never got round to sorting out this (and presumably other) appallingly badly-designed tables.

    Indeed, having encapsulated the functionality that accesses that table, refactoring within that specific context may well be a project which can be farmed out to a small dedicated team. It may even be assigned as a training exercise.

    We embarked on a similar approach when a major app needed a (well-defined) refactoring of a specific aspect of our flagship product at the same time as a team of developers needed some intensive training on precisely that aspect of the product. Hence they packed the technical design leader off to present this refactoring job as a week-long training course at the development team's office location.

    A lovely week in exotic Bucharest. Oh, how I miss that place.

  • charles (unregistered) in reply to LZ79LRU

    Until of course the fateful day when you find actual data in the "Comments" field which needs to be acted upon by your software. At which point you're into trying to parse strings which have been hand-typed by human beings. What could possibly go wrong?

  • (nodebb) in reply to Prime Mover

    I suspect that the database structure and design of accessors is a legacy of the original design.

    The original design was likely an Excel spreadsheet so the database needs to work like that too. We all know how that turns out.

  • Jeremy (unregistered)
    Comment held for moderation.
  • LZ79LRU (unregistered)
    Comment held for moderation.
  • (nodebb) in reply to dkf

    For those too lazy to otherwise count, that looks to me like it is a database table with at least 84 columns. I've never heard of anything of that scale where there wasn't a better design with more tables and less denormalization.

    84? I regularly work with tables with hundreds of columns. Now, we don't necessarily use all those columns in our implementation, but they're still there. You get used to the "(select col1, col2, col3 from tablename) as tablename" workaround to avoid the Oracle error with having more than 1000 columns in a joined table.

Leave a comment on “In House Refactoring”

Log In or post as a guest

Replying to comment #:

« Return to Article