Object-Oriented Programming Lab (OOPL) Final Report
Title: Café Management System
1. Introduction
Managing a café efficiently involves handling menu items, processing customer orders, and
ensuring smooth operations. This project presents an Object-Oriented Programming (OOP)-
based Café Management System using Swing GUI to streamline menu management and
item retrieval. The system leverages OOP principles like inheritance and polymorphism, and
ensures a user-friendly experience through an intuitive graphical interface.
2. Objectives
● Develop an OOP-based Café Management System.
● Implement features to dynamically add, retrieve, and display menu items.
● Apply OOP principles such as inheritance, polymorphism, encapsulation, and
abstraction.
● Provide an interactive GUI using Java Swing for smooth user interaction.
3. System Design and Implementation
a. Class Diagram:
MenuItem
- name: String
- price: double
+ getName(): String
+ getPrice(): double
+ toString(): String
Beverage Food
- isHot: boolean - isVegan: boolean
+ isHot(): boolean + isVegan(): boolean
+ toString(): String + toString(): String
Menu
-items:List<MenuItem>
+ addItem(MenuItem): void
+ findItemByName(String): MenuItem
+ getAllItems(): List<MenuItem>
CafeManagementSystem
(Contains GUI code)
b. Class Structure
● Main class: CafeManagementSystem – contains the main method and controls
GUI. The createAndShowGUI method is called which handles the main GUI with
other helper methods.
● Parent class: MenuItem – abstract class defining shared attributes like name, price,
and methods.
● Child classes: Beverage, Food – inherit from MenuItem and define category-
specific behavior.
● Layout class: WrapLayout – Custom layout class for wrapping components.
● Group class: Menu – stores and manages a list of MenuItem objects.
c. Features Implemented
● Inheritance: Beverage and Food classes inherit from MenuItem to reuse code.
● Encapsulation: Attributes like item name and price are private, with getters/setters.
● Method Overloading & Overriding: Used to handle multiple types of menu
operations.
● Polymorphism: MenuItem references are used to handle both Food and
Beverage objects.
● Swing GUI: Interactive user interface includes buttons, dialogs, and text areas for
input/output.
4. Testing and Debugging
● Unit Testing: Performed on Menu, MenuItem, and its child classes.
Output of Unit Test:
● GUI Testing: Ensured all GUI components function as expected and events trigger
correct behaviour.
1. Here the Red Marked area on the right is used to add an item to the Café
menu, and the Green Marked area on the left is used to find items with
name.
2. The Add Item panel lets the user add a new item to the menu by placing item
name and price in their dedicated fields marked with Green Box. Then the
user must select an option between Food and Drinks. If the user picks Food
a new panel with label Vegan? appears and options Yes and No appears.
The selected button will be Highlighted. Similarly if the user picks Drinks
then a new panel with label Hot? appears and options Yes and No are
displayed.
3. If the user skips any of the fields(and press Confirm), an error message is
displayed.
4. If the user skips the Food or Drinks option and/or skips the Yes or No option,
an error message is displayed.
5. The Blue Circled area shows the Confirm button, which if pressed after
proper inputs, will show a dialogue box confirming the item added
successfully.
6. Finally, the Add Item panel is reset and in the Centre panel all the items are
displayed.
7. On the left side the Find Item panel is used to find items by name. When a
user places a name in the text field in Find Item panel and presses enter,
only that item will displayed in the Centre panel.
8. If the user wants to again view all items in the menu, they can press Show All
Items button. Which will display all the items in the menu in the Centre panel.
● Exception Handling: Validated user inputs (e.g., non-numeric price) to prevent
crashes and errors.
● Functional Testing: Verified the working of add, search, and display functionalities
through sample data.
5. Results and Discussion
● The system was able to successfully add, retrieve, and display both beverages and
food items.
● OOP concepts enhanced the system structure and allowed easy scalability for future
features.
● The Swing-based GUI made the system accessible and user-friendly, suitable for
small café operations.
● Overall, the objectives of the project were achieved effectively through systematic
implementation.
6. Challenges and Mitigation Strategies
● Real-time Menu Updates: Initially challenging but managed through use of
ArrayList for dynamic storage.
● GUI Complexity: Modular design and action listeners reduced confusion and
streamlined code.
● Error Handling: Implemented try-catch blocks and input validation to handle
edge cases and invalid input.
7. Conclusion and Future Enhancements
This project demonstrated how Object-Oriented Programming can be effectively used to
create real-world applications. The Café Management System is a fully functioning
application built with Java Swing and object-oriented principles.
Future Enhancements may include:
● Database integration for persistent storage of menu items and orders.
● Order management system for real-time tracking.
● Mobile app version for easier access and usage.
● Enhanced UI/UX and theme customization.
8. Appendix
Knowledge Profile Coverage (K1–K8)
● K1 – Natural Sciences: Applied logical reasoning to design a structured and efficient
system.
● K2 – Mathematics & Computer Science: Implemented data structures
(ArrayList) and search algorithms.
● K3 – Engineering Fundamentals: Applied software engineering principles to
system design and testing.
● K4 – Specialist Knowledge: Applied Java OOP concepts like abstract classes, GUI
design, and exception handling.
● K5 – Engineering Design: Designed and implemented GUI interactions with object-
oriented logic.
● K6 – Engineering Practice: Practiced real-world application building using OOP and
user feedback handling.
● K7 – Role of Engineering in Society: Created a tool that can reduce human error
and improve business productivity.
● K8 – Research Literature: Adapted OOP best practices from standard software
design patterns.
Complex Engineering Problem Attributes (P1–P7)
● P1 – Depth of Knowledge: Demonstrated understanding of core OOP concepts
through practical implementation.
● P2 – Conflicting Requirements: Balanced the need for a simple GUI with
comprehensive functionality.
● P3 – Depth of Analysis: Carefully structured classes and relationships for
maintainability.
● P4 – Familiarity of Issues: Addressed known problems like input errors, dynamic
updates, and user experience.
● P5 – Applicable Codes: Followed Java programming standards, clean code
practices, and GUI design patterns.
● P6 – Stakeholder Involvement: Considered end-user needs (café staff, manager)
while designing functionality.
● P7 – Interdependence: Integrated multiple components (backend logic + GUI) for
complete system functionality.
Alignment with B.Sc. in CSE Program Outcomes (POs)
● PO(a): Applied engineering and programming knowledge to develop a Java-based
software system.
● PO(b): Identified and analyzed problems in traditional café operations.
● PO(c): Designed a solution using OOP that addresses real-world challenges.
● PO(d): Investigated system effectiveness and user interaction issues during
development.
● PO(e): Utilized Java and Swing as modern development tools.
● PO(f): Met real-world needs of small business owners with better inventory handling.
● PO(g): Promoted resource efficiency by minimizing paper/manual tracking.
● PO(h): Delivered a stable and user-friendly system with proper validations.
● PO(i): Worked collaboratively in design, coding, and testing phases.
● PO(j): Documented project processes clearly through this final report.
● PO(k): Followed a planned timeline for systematic development and testing.
● PO(l): Gained hands-on experience that encourages continuous learning in software
engineering.