Simple Food Delivery Ordering System (No Database) Implemented in Java
This article presents a step‑by‑step tutorial for building a console‑based food delivery ordering system in Java without a database, covering entity class design, DAO interfaces, management classes for admins, dishes, orders and users, as well as a menu‑driven UI and sample test code.
The tutorial demonstrates how to create a lightweight food‑delivery ordering system in Java that operates entirely in memory, avoiding any external database.
Entity classes are defined for the core concepts: Admin (admin ID, account, password), Dishes (ID, name, type, launch date, price, monthly sales, stock), Order (order ID, timestamp, associated dish, quantity, user ID, total price, status), and User (user ID, name, gender, password, address, phone, creation time). Each class provides private fields, constructors, getters, setters, and a toString() method.
DAO interface DAO declares generic CRUD methods ( insert , findById , findAll , delete ) that are implemented by the management classes.
Management classes implement the DAO for each entity:
AdminSys handles admin operations such as adding dishes, viewing dishes with pagination, modifying dish prices, deleting dishes, managing users, and changing order status.
OrderSys stores orders in a HashMap and provides methods to insert, find by ID, retrieve all orders, and list orders for a specific user.
UserSys maintains a HashMap of users, offering insertion, deletion, lookup, and password‑change functionality.
DishesSys manages dishes, supporting insertion, lookup by ID or type, retrieval of all dishes, and deletion.
Menu class provides a text‑based UI. It authenticates either an admin or a user, then displays role‑specific menus. Admins can select options 1‑11 to perform CRUD operations on dishes, users, and orders; users can place orders, view dishes by category, check their orders, change passwords, and view personal information.
Test class simply creates a Menu instance and invokes showMenu() to start the application.
The article also includes several screenshots (not reproduced here) that illustrate the console prompts and sample interactions for both admin and user workflows.
Java Captain
Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.