Java ATM CLI Dev Log #3: VTU Features

Published: (December 26, 2025 at 02:16 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Overview

Building the VTU (Virtual Top‑Up) feature was straightforward in concept, though it required a substantial amount of code. With the assistance of Gemini Code Assist, I was able to implement the functionality quickly. Initially, I hard‑coded the airtime and data plans directly in the code to get things working. Now that the feature is functional, I plan to move the VTU plans to a database and retrieve them dynamically.

Issues Encountered

UX Flaw with PIN Prompt

While testing, I noticed a user‑experience issue: after completing one service (e.g., withdrawing money) and then selecting another service such as “Recharge Airtime/Data,” the application asks for the PIN again. This repeated PIN entry is inconvenient and should be fixed before adding more features.

Hard‑coded Plans

Hard‑coding the airtime and data plans makes the code less maintainable. Refactoring to store these plans in a database will improve flexibility and scalability.

Future Work

  • Implement Caching: Learn and integrate caching to store frequently accessed data temporarily, reducing database calls and improving performance.
  • Fix PIN Re‑prompt: Adjust the session handling so that the PIN is required only once per transaction session.
  • Database Integration: Move VTU plans (airtime and data) from hard‑coded values to a database and fetch them as needed.

Repository

You can view the source code on the GitHub repository: GitHub repo.

Back to Blog

Related posts

Read more »