How akashreya/was_cloud works
Project Type and Purpose
• This is a Java-based full-stack web application (“seat assignment system”) built with Servlet/JSP front-end, Spring 3.1 MVC, Hibernate 3 ORM, and MySQL persistence. It follows a classic layered MVC + DAO architecture.
Main Components
a. Client Layer
• Browser/UI – JSP pages (index.jsp, createEmployeeAjax.jsp, createSeatAjax.jsp) plus static assets (CSS, JS, images).
b. Web/Application Server
• Web Container (Tomcat/WebSphere) hosting:
– DispatcherServlet (Spring MVC)
– FrontController (com.smartans.controller.FrontController)
– WASServletContextListener (com.smartans.listener)
c. Service Layer
• Interfaces and implementations for business logic (MaintainEmployees, MaintainSeats, MaintainDesignations, SeatAssignment)
d. Data Access Layer
• DAO interfaces and impls (ManageEmployeesDaoImpl, ManageSeatsDaoImpl, ManageDesignationDaoImpl, SeatAssignmentDaoImpl)
• Mappers (e.g., EmployeeMapper) for DTO ⇄ entity translation
e. Persistence & Cache
• Hibernate SessionFactory (hibernate.cfg.xml, .hbm.xml mapping files)
• Connection pool (c3p0/proxool)
• Second-level cache (Ehcache)
f. Database
• MySQL (scripts/scripts.sql, testdata.sql)
g. Cross-cutting Concerns
• Logging (Log4J)
• Transactions (Spring’s transaction management)
• Validation/Error handling (custom exception classes)
Relationships & Data Flow
• User → HTTP Request → DispatcherServlet
• DispatcherServlet → FrontController (routes to specific @Controller or handler)
• FrontController → Service Layer (calls business interfaces)
• Service Layer → DAO Layer (CRUD via Hibernate Session)
• DAO Layer → MySQL DB
• Responses bubble back through layers to UI
Architectural Patterns & Principles
• MVC (Spring MVC) separating view (JSP) from controllers and business logic
• Service/DAO layered architecture
• Dependency Injection/IoC (Spring beans defined in applicationContext.xml, dispatcher-servlet.xml)
• ORM + caching (Hibernate + Ehcache)
• Transaction management via Spring
• Exception hierarchy for domain errors