How joseriospacheco/cine works
Main Components
• Client (Browser/User) Interface – separate areas for regular users (e.g., index.jsp, login.jsp, reserva.jsp) and for administrators (located under web/admin).
• Web Layer (Presentation) – JSP pages (regular and admin), along with supporting HTML, CSS, JavaScript (JQuery, Ajax) used by the frontend.
• Controller & Business Logic Layer – the backend code found in the src directory. Under the “Datos” package, you have data access objects (such as BibliotecaDB, DatosButacas, etc.) that encapsulate database queries and business rules. The “Entidades” package represents the data models (e.g., Pelicula, Reserva, Sala, etc.).
• Persistence Layer – MySQL database as indicated by the cinema.sql file. This layer stores the application’s data such as movies, reservations, users, and cinema details.
• External Services – A component for integration with the IMDb API to fetch movie details automatically.
• Configuration/Deployment – Build files (build.xml, nbproject files) and configuration files (MANIFEST.MF, sun-web.xml) that support project building and deployment.
Relationships and Interactions
• The Client Interface uses browsers to send HTTP requests to the web layer (JSPs). Different JSPs are dedicated to admin features (e.g., agregarFunciones.jsp, modificarPeliculas.jsp) and user interactions (e.g., registrarme.html, reserva.jsp).
• The web layer, following the MVC pattern, acts as the controller to delegate requests to the proper business logic components within the “src” directory.
• The business logic layer (Datos classes) communicates with the MySQL database to retrieve and update persistent data.
• When movie data is needed, a separate component handles the API call to IMDb and returns JSON data, which is then processed by the application.
Highlighting Architectural Patterns
• The MVC (Model-View-Controller) pattern is evident: the JSPs provide the View, the servlets/JSP pages invoke business logic (Controller), and the “Entidades” along with “Datos” packages represent the Model.
• The separation of concerns is clearly maintained by placing interface files (under web) separate from the Java source code (under src).
• There is a clear distinction between the admin and public functionalities, which should be represented as separate but interacting components.
Relevant Technologies and Frameworks
• Frontend: HTML, CSS, JQuery, Ajax (for dynamic content updates).
• Backend: Java/JSP, MVC architecture.
• Database: MySQL.
• External API Integration: IMDb’s API (returning JSON).
• Development/Build Environment: NetBeans (as suggested by nbproject files), with Ant used for building (build.xml).