Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 5, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 5, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 5, 2025

      In MCP era API discoverability is now more important than ever

      June 5, 2025

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025

      7 reasons The Division 2 is a game you should be playing in 2025

      June 5, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025
      Recent

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025

      IDMC – CDI Best Practices

      June 5, 2025

      PWC-IDMC Migration Gaps

      June 5, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025
      Recent

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»A Single Mortgage

    A Single Mortgage

    April 14, 2025

    We talked about singletons a bit last week. That reminded John of a story from the long ago dark ages where we didn’t have always accessible mobile Internet access.

    At the time, John worked for a bank. The bank, as all banks do, wanted to sell mortgages. This often meant sending an agent out to meet with customers face to face, and those agents needed to show the customer what their future would look like with that mortgage- payment calculations, and pretty little graphs about equity and interest.

    Today, this would be a simple website, but again, reliable Internet access wasn’t a thing. So they built a client side application. They tested the heck out of it, and it worked well. Sales agents were happy. Customers were happy. The bank itself was happy.

    Time passed, as it has a way of doing, and the agents started clamoring for a mobile web version, that they could use on their phones. Now, the first thought was, “Wire it up to the backend!” but the backend they had was a mainframe, and there was a dearth of mainframe developers. And while the mainframe was the source of truth, and the one place where mortgages actually lived, building a mortgage calculator that could do pretty visualizations was far easier- and they already had one.

    The client app was in .NET, and it was easy enough to wrap the mortgage calculation objects up in a web service. A quick round of testing of the service proved that it worked just as well as the old client app, and everyone was happy – for awhile.

    Sometimes, agents would run a calculation and get absolute absurd results. Developers, putting in exactly the same values into their test environment wouldn’t see the bad output. Testing the errors in production didn’t help either- it usually worked just fine. There was a Heisenbug, but how could a simple math calculation that had already been tested and used for years have a Heisenbug?

    Well, the calculation ran by simulation- it simply iteratively applied payments and interest to generate the entire history of the loan. And as it turns out, because the client application which started this whole thing only ever needed one instance of the calculator, someone had made it a singleton. And in their web environment, this singleton wasn’t scoped to a single request, it was a true global object, which meant when simultaneous requests were getting processed, they’d step on each other and throw off the iteration. And testing didn’t find it right away, because none of their tests were simulating the effect of multiple simultaneous users.

    The fix was simple- stop being a singleton, and ensure every request got its own instance. But it’s also a good example of misapplication of patterns- there was no need in the client app to enforce uniqueness via the singleton pattern. A calculator that holds state probably shouldn’t be a singleton in the first place.


    [Advertisement]
    Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDevelop Frontend Without a Backend Using Mock Service Worker
    Next Article rbw is an unofficial Bitwarden CLI

    Related Posts

    News & Updates

    Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

    June 5, 2025
    News & Updates

    Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

    June 5, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    When is Apple Intelligence out for the iPhone 16? Here’s what you need to know

    Artificial Intelligence

    Windows 11 version 25H2: Everything you need to know about Microsoft’s next OS release

    News & Updates

    Mar 28, 2025: AI updates from the past week — Gemini 2.5, OpenAI 4o image generation, new reasoning agents from Microsoft, and more

    Tech & Work

    French Business Email Database List

    Web Development

    Highlights

    CVE-2025-5647 – Radare2 Radiff2 Memory Corruption Vulnerability

    June 5, 2025

    CVE ID : CVE-2025-5647

    Published : June 5, 2025, 9:15 a.m. | 2 hours, 25 minutes ago

    Description : A vulnerability was found in Radare2 5.9.9 and classified as problematic. This issue affects the function r_cons_context_break_pop in the library /libr/cons/cons.c of the component radiff2. The manipulation of the argument -T leads to memory corruption. The attack needs to be approached locally. The complexity of an attack is rather high. The exploitation is known to be difficult. The exploit has been disclosed to the public and may be used. The real existence of this vulnerability is still doubted at the moment. The patch is named 5705d99cc1f23f36f9a84aab26d1724010b97798. It is recommended to apply a patch to fix this issue. The documentation explains that the parameter -T is experimental and “crashy”. Further analysis has shown “the race is not a real problem unless you use asan”. A new warning has been added.

    Severity: 2.5 | LOW

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    NVIDIA AI Releases HelpSteer2 and Llama3-70B-SteerLM-RM: An Open-Source Helpfulness Dataset and a 70 Billion Parameter Language Model Respectively

    June 18, 2024

    One of the best Xbox games suddenly got Xbox Play Anywhere support out of the blue

    February 18, 2025

    AVerMedia Elite Go GC313Pro review: This little charging brick is a must-have for streamers on the go

    January 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.