How boanlai/assignment0704 works
Project type and purpose
• This is a Maven-based Java EE web application (an interview assignment implementing a seating chart and employee management UI).
• It follows a classic 3-tier architecture: Presentation (JSP + JavaScript), Business (domain objects and controllers), and Data Access (DAO/Service + Database).
File structure
• Top-level artifacts
• pom.xml → Maven build + dependencies
• src/main/webapp → JSPs, JavaScript, web.xml, context.xml
• src/main/java/com/business → domain controllers and model objects
• src/main/java/com/data → DAO interfaces, JNDI DAO implementations, Service façade, VO (Value Objects)
• src/main/java/com/common → XSSFilter
• src/main/webapp/DB → SQL initialization script
• web.xml & context.xml define the web filter, servlet mappings (if any), and JNDI DataSource
README
• Minimal description: “an interview assignment,” confirming this is a simple CRUD/demo web app
Main components
a. Client Browser
• index.jsp + JavaScript modules (addEventListener.js, changeSeatColor.js, insertEmp.js, insertSeat.js, pageInit.js, resetSeatingChart.js)
b. Web Container (e.g., Apache Tomcat)
• XSSFilter (com.common.XSSFilter)
• JSP Rendering Engine
• Servlet container (executes JSP calls into com.business classes)
c. Presentation Layer
• JSP pages under /presentation
• JavaScript front-end logic
d. Business Layer
• com.business.MainPage, SeatingChart, Employee domain classes
• Orchestrates user actions and calls Service layer
e. Service Layer (facade)
• com.data.employee.EmployeeService
• com.data.seatingChart.SeatService
f. Data Access Layer (DAO)
• Interfaces: EmployeeDAO_interface, SeatDAO_interface
• JNDI implementations: EmployeeJNDIDAO, SeatJNDIDAO
• VO classes: EmployeeVO, SeatVO
g. Database
• RDBMS (configured via JNDI in context.xml)
• Initialized by bank_assignment.sql
Relationships & data flow
1. User issues HTTP request → Browser
2. → Web Container
a. XSSFilter sanitizes input
b. Request dispatched to JSP or servlet/controller in com.business
3. Business Layer processes request, builds domain objects
4. Calls Service Layer
5. Service Layer invokes DAO interface
6. DAO (JNDI DAO) obtains JDBC Connection from DataSource → executes SQL on Database
7. Results → VO → Service → Business → JSP
8. JSP renders HTML/JS → Browser
Architectural patterns & design principles
• Layered architecture (Presentation → Business → Service → DAO → Database)
• DAO pattern + Service façade
• Use of JNDI for connection pooling
• XSSFilter implements Cross-Site Scripting protection
Elements
• Clear labels: “Browser,” “Tomcat Web Container,” “XSSFilter,” “JSP Pages,” “Business Controllers,” “Service Layer,” “DAO Layer,” “Database”
• Technology stacks: “Java/JSP/JavaScript,” “Maven,” “JNDI DataSource,” “JDBC,” “MySQL/PostgreSQL (SQL script)”