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. Other Discussions
  3. The Weird and The Wonderful
  4. Update 12.03B: There are no longer 16 ounces in a Pound

Update 12.03B: There are no longer 16 ounces in a Pound

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasebusinessquestionannouncement
15 Posts 9 Posters 5 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.
  • N Offline
    N Offline
    Netblue
    wrote on last edited by
    #1

    I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

    D A B P P 7 Replies Last reply
    0
    • N Netblue

      I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      :laugh:

      Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

      N 1 Reply Last reply
      0
      • N Netblue

        I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

        A Offline
        A Offline
        Adam Maras
        wrote on last edited by
        #3

        Netblue wrote:

        The previous programmer could have at least cached the data on the client side or something...

        But that would make sense! :laugh:

        1 Reply Last reply
        0
        • D Dan Neely

          :laugh:

          Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

          N Offline
          N Offline
          Netblue
          wrote on last edited by
          #4

          Frankly, I wouldn't be suprised to find this in the documentation somewhere: http://en.wikipedia.org/wiki/Image:English_mass_units_graph.svg[^]

          1 Reply Last reply
          0
          • N Netblue

            I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

            B Offline
            B Offline
            Brent Lamborn
            wrote on last edited by
            #5

            Do they happen to be storing the current time in the database as well? :D


            "Half this game is ninety percent mental." - Yogi Berra If you can read thank a teacher, if you can read in English, thank a Marine.

            N 1 Reply Last reply
            0
            • B Brent Lamborn

              Do they happen to be storing the current time in the database as well? :D


              "Half this game is ninety percent mental." - Yogi Berra If you can read thank a teacher, if you can read in English, thank a Marine.

              N Offline
              N Offline
              Netblue
              wrote on last edited by
              #6

              I think there is a webservice call for that one...

              L 1 Reply Last reply
              0
              • N Netblue

                I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

                P Online
                P Online
                PIEBALDconsult
                wrote on last edited by
                #7

                How many ounces are in a pint?

                N 1 Reply Last reply
                0
                • N Netblue

                  I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #8

                  Netblue wrote:

                  The previous programmer could have at least cached the data on the client side or something...

                  That would have been nice.

                  Netblue wrote:

                  The worst part is this database is almost always called over a VPN connection, so bandwidth is critical.

                  Is it possible to make any changes to that or are you stuck with it?

                  "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                  N 1 Reply Last reply
                  0
                  • P Paul Conrad

                    Netblue wrote:

                    The previous programmer could have at least cached the data on the client side or something...

                    That would have been nice.

                    Netblue wrote:

                    The worst part is this database is almost always called over a VPN connection, so bandwidth is critical.

                    Is it possible to make any changes to that or are you stuck with it?

                    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                    N Offline
                    N Offline
                    Netblue
                    wrote on last edited by
                    #9

                    Paul Conrad wrote:

                    Is it possible to make any changes to that or are you stuck with it?

                    There are 8 locations connecting to a central site, VPN over the net. A better way to do it would be SQL replication, but the locations can't support a server of their own, at least not right now.

                    P 1 Reply Last reply
                    0
                    • N Netblue

                      Paul Conrad wrote:

                      Is it possible to make any changes to that or are you stuck with it?

                      There are 8 locations connecting to a central site, VPN over the net. A better way to do it would be SQL replication, but the locations can't support a server of their own, at least not right now.

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #10

                      That's a bummer.

                      Netblue wrote:

                      A better way to do it would be SQL replication

                      Sure, but then that could open up a new can of worms when trying to manage all those replications and synchronize them, if you needed to. Maybe not, because I don't know what kind of data flow or volume you are dealing with.

                      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                      1 Reply Last reply
                      0
                      • P PIEBALDconsult

                        How many ounces are in a pint?

                        N Offline
                        N Offline
                        Netblue
                        wrote on last edited by
                        #11

                        IF your lucky 20, if your in the states typically 14, unless your local pub has the good glasses that allow a full 16 with 2 inches of head. :-D

                        P 1 Reply Last reply
                        0
                        • N Netblue

                          I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

                          C Offline
                          C Offline
                          Chris Maunder
                          wrote on last edited by
                          #12

                          Just a second here: What if the application was being used in the UK, then used in the US or Australia? Conversions do vary... ;) (though maybe a localised lookup table, and, sure - why not - a little caching or even dare I suggest hardcoding might help perf a little ;))

                          cheers, Chris Maunder

                          CodeProject.com : C++ MVP

                          1 Reply Last reply
                          0
                          • N Netblue

                            IF your lucky 20, if your in the states typically 14, unless your local pub has the good glasses that allow a full 16 with 2 inches of head. :-D

                            P Online
                            P Online
                            PIEBALDconsult
                            wrote on last edited by
                            #13

                            You only get two inches of head? :~

                            1 Reply Last reply
                            0
                            • N Netblue

                              I am refactoring a project that has basic unit conversion stored in a sql database along with everything else. Each time a business object gets loaded from the database, a separate call to the database is made to get the 3 units that belong to the business object. When is the last time any of these natural conversion has changed? Are they suddenly going to change the amount of milligrams in a gram, or pounds in a ton? If there were any conversions that were irregular like grams in a case or something like that, I understand, but for the natural conversions? The worst part is this database is almost always called over a VPN connection, so bandwidth is critical. The previous programmer could have at least cached the data on the client side or something...

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              And then somebody suddently alters some conversions in the database and all clients with the cached data will have an update problem until the next session. To avoid this, we now need a way to let the clients know that the cached data is not up to date. And then.... :) Honestly, this is exactly what blind obedience to 'good practices' leads to. Of course it's a good idea to make the database work for its money, but this should nonetheless have been avoided. Quick and dirty solutions to correct this lead to still more quick and dirty patches. Recommended practices can not replace thinking.

                              A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

                              1 Reply Last reply
                              0
                              • N Netblue

                                I think there is a webservice call for that one...

                                L Offline
                                L Offline
                                leonej_dt
                                wrote on last edited by
                                #15

                                lmao

                                To those who understand, I extend my hand. To the doubtful I demand: Take me as I am. Not under your command, I know where I stand. I won't change to fit yout plan. Take me as I am.

                                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