HeadlinesBriefing favicon HeadlinesBriefing.com

Java TicketDesk System for Role-Based Auth

DEV Community •
×

A student built a TicketDesk system in Java for an intro programming module, implementing role-based authentication for admins, users, and guests. Admins manage tickets and accounts, users create tickets, and guests have read-only access. The system uses Scanner class for console input, preferring `parseInt()` over `nextInt()` to avoid common newline issues.

The project applies object-oriented programming with a `Person` class and subclasses like `Admin`. It addresses practical challenges, including a helper method to validate input and prevent commas from breaking data storage. A simple solution for console output overflow prompts users to press ENTER to review lists before returning to the menu.

For reliability, the program automatically creates a missing ticket file to prevent crashes. The developer reflects on balancing the single responsibility principle with practical efficiency. This project demonstrates core Java concepts like inheritance, encapsulation, and error handling for building functional, role-aware applications.