How sathvikpm/onifoods works
• The Web Layer (View) is represented by the JSP files found in the src/main/webapp directory (e.g., Login.jsp, Signup.jsp, cart.jsp, orderSuccess.jsp). These elements provide the user interface and handle session-based interactions.
• The Controller Layer is implemented with multiple Servlets (found in the src/main/java/com/tap/controller directory), such as CartServlet, LoginServlet, MenuServlet, OrderServlet, RestaurantServlet, and SignUpServlet. They process incoming HTTP requests, manage session information, and coordinate with the business and database layers.
• The Data Access Layer is split into DAO interfaces and their concrete implementations (located in the src/main/java/com/tap/dao and daoImp directories). This layer handles all interactions with the database (MySQL) via JDBC, ensuring a clean separation between the business logic and persistence logic.
• The Domain Model is defined by the Java classes under src/main/java/com/tap/model. These classes (User, Restaurant, Menu, Order, OrderHistory, Cart, CartItem, etc.) represent the various entities central to the application's business logic.
Main components
• Web Client Layer: Show end-user devices accessing the application, which display web pages (JSPs).
• Web Server/Application Server: This component (typically a Servlet container like Tomcat) hosts the web application.
• Controller Components: Illustrate each Servlet (Login, Signup, Menu, Cart, Order, Restaurant controllers) as entry points to the application logic.
• Business/Data Access Layer: Detail the DAO and DAO implementation classes that encapsulate database operations.
• Domain Model: Represent the key model entities (User, Restaurant, Menu, Order, etc.), showing that these objects flow between controllers and DAOs.
• Database: Represent the MySQL database that holds the persistent application data.
• External Libraries: Optionally illustrate tools like the MySQL Connector/J (included in WEB-INF/lib) and possibly the JDBC mechanism as a link to the database.
Relationships and interactions
• Controllers as the intermediaries intercepting HTTP requests (from JSP forms or links) and coordinating with the Business/Data Access Layer.
• That Controllers invoke methods on the DAOs to query or update the MySQL database.
• If applicable, include components for user authentication and admin dashboard features as noted in the README.
Architectural patterns and design principles
• MVC paradigm: Clearly separate the front-end JSP views, back-end controllers (servlets), and data handling via models and DAOs.
• Layered architecture: Emphasize that each layer (presentation, controller, data access, and database) operates independently and communicates through defined interfaces.
• Modularity: Each servlet, DAO, and model represents a distinct module, which makes the system both testable and extendable. For instance, the test classes found under daoImp (like OrderHistoryDaoTest and OrderItemDaoTest) show efforts in modular testing.
Relevant technologies
• Java, Servlets for dynamic web operations.
• JDBC as the database connectivity framework.
• MySQL for persistent storage.
• HTML/JSP and CSS for frontend design.
• External libraries like the MySQL Connector/J.