How lesvinyesdam/asistenciaform works
Project Type & Purpose
• This is a Java application built primarily with JavaFX (as indicated by the several FXML files) for managing attendance (fichaje) using NFC technology.
• The project leverages the Model-View-Controller (MVC) pattern: FXML files represent the views, while Controllers in the package (under org.vinyes.asistencia.Controllers) handle user interactions; Entities represent data models.
• Additional modules include NFC reading/writing, database connectivity, and security (e.g., encryption), indicating an architecture with multiple layers of functionality.
Analyzing the File Structure
• Main Directory “Asistencia”: Contains the complete application including UI forms, controllers, database connectors, NFC driver code, and security utilities.
• Java Source Code (in /src/main/java/org/vinyes/asistencia):
• Controllers: These classes (e.g., LoginScreenController, FirstScreenController, etc.) manage user interactions and coordinate between the view and the underlying logic.
• Entities: POJOs such as “Login” and “Usuario” that represent data structures in the application.
• Database: Modules like DatabaseConnection and RegistroDAO indicate a dedicated data access layer. Also, SQL scripts and CSV files are present, suggesting there is an embedded or configured database.
• NFCDriver: Contains NFCReader and DatabaseWriter classes to handle communication with NFC hardware.
• Security: Contains the Encryption class to secure sensitive data.
• The MainApplication class is the entry point, initializing the application.
• Resource Files: The FXML files in the /resources directory define the UI layout for various screens such as login, registration, and management.
• Build & Dependency Files: Maven-related files (pom.xml, mvnw) indicate that the project is built using Maven.
a. Main Components:
• User Interface (UI): Represented by the FXML files (first-screen.fxml, login-screen.fxml, etc.) under /src/main/resources.
• Controllers: The various controllers handling UI events (e.g., LoginScreenController, GestionUsuarioController).
• Business Logic / Domain Layer: Entities (Login, Usuario) and potentially any service logic within the controllers.
• Database Layer: Database, including DatabaseConnection and DAO classes, interacting with SQL scripts (db.sql) and CSV/database files.
• NFC Module: NFCDriver components (NFCReader, DatabaseWriter) that handle NFC interactions.
• Security Module: Encryption class that supports data integrity and confidentiality.
• Integration/Startup: MainApplication serves as the application bootstrap.
b. Relationships & Interactions:
• The UI sends user actions to Controllers.
• Controllers interact with the Domain models (Entities) and invoke business logic.
• Data is persisted or retrieved via the Database layer (using DAO methods).
• The NFC module is integrated to read/write data (likely triggered by the UI or controllers) to handle attendance via NFC.
• Security functions are invoked during data handling for encryption or other secure interactions.
c. Architectural Patterns and Design Principles:
• MVC (Model-View-Controller) separates presentation (FXML files and views), control (Controllers), and data (Entities + Database access).
• Modular separation where NFC-specific functionality is isolated in its own package.
• Use of dependency injection or similar patterns might be inferred from the clear separation between the user interface, data access, and external NFC interaction.
• The use of a Database Access Object (DAO) pattern is evident from the RegistroDAO class.
d. Notable Technologies and Frameworks:
• Java and JavaFX for the frontend.
• Maven as the build and dependency management tool.
• Standard Java packages for security and database access.
• External NFC hardware integration through dedicated driver classes.