Casino Management System
Overview
The Casino Management System is a desktop application developed as a university project. It simulates the management of a casino’s core operations, handling users (players and administrators), games, betting, chip management, and machine maintenance. The application features a graphical user interface built with Java Swing and interacts with a PostgreSQL database through JDBC for all data persistence needs.
This project was a collaborative effort with two students, focusing on applying object-oriented design principles, implementing a robust Model-View-Controller (MVC) architecture, and gaining hands-on experience with relational database design and interaction.
Features
- Dual Interfaces: Separate, role-specific GUIs for Players and Administrators.
- User Management: Registration, authentication, and profile management for players. Full CRUD operations for administrators.
- Game Management: Administrators can create and manage different types of games (Competitive and Machine-based). Players can view and join available games.
- Betting System: Players can place bets on games, with administrators managing bet records.
- Chip System: A detailed chip management system allowing players to exchange chips for money and vice-versa. Administrators can define chip types and quantities.
- Machine & Parts Management: Administrators can manage mechanical game machines and their constituent parts.
- Database Integration: All data is persisted in a PostgreSQL database, ensuring consistency and reliability.
The system aims to provide a simulation of core casino management functionalities, demonstrating the integration of a desktop frontend with a backend database.
Technical Details
The application is structured following the Model-View-Controller (MVC) architectural pattern to ensure a clear separation of concerns:
- Model: Contains the core business logic and data entities. It also includes classes that act as intermediaries between the GUI and the database layer.
- View: Built entirely with Java Swing. It includes various classes for different windows and for managing data display in tables and lists.
- Controller: The central facade that coordinates interactions between the GUI and the database layer.
- Data Access Layer: Manages the connection to the PostgreSQL database using JDBC. It includes Data Access Object classes for each entity to encapsulate all SQL queries and database interactions.
Challenges and Solutions
Developing a desktop application with a relational database presented several challenges:
- Complex GUI State Management: Managing the state of numerous interactive components across different views required careful design of data models and update logic.
- Database Schema Design: Designing a normalized relational schema to accurately represent the entities and relationships within a casino was crucial. Special care was taken with subtype relationships.
- Concurrency and Data Integrity: Ensuring data integrity with concurrent access was a key concern, handled primarily through database transactions and constraints.
- Team Collaboration: Coordinating development efforts among three team members required clear communication, defined interfaces between components, and consistent coding standards.
Using the MVC pattern and DAOs proved effective in managing complexity and promoting a clean, maintainable codebase.
Lessons Learned
This project provided invaluable experience with team-based software development, object-oriented design, and database integration. During the assessment day, we successfully demonstrated the application’s functionalities, and modified the code live to add a new feature, showcasing our understanding of the system.