How sii-informatica-uma/mini-pim-plytix-digital-dynamics works
Project type and purpose
• This is a single Spring-Boot microservice named “microservice_gestor_productos.”
• Its sole responsibility is managing product data (CRUD operations on products, attributes, categories, relations).
• It exposes HTTP endpoints (controllers), uses a service layer for business logic, persists data in a relational DB via JPA repositories, and maps between DTOs and entities.
File structure
• Top‐level folder “microservice_gestor_productos” contains:
• pom.xml, mvnw* files, .mvn wrapper → Maven‐based Java project
• src/main/java/.../controladores → REST API controllers + Mapper classes
• src/main/java/.../servicios → service layer (business logic)
• src/main/java/.../repository → Spring Data JPA repositories
• src/main/java/.../entity → JPA entity classes
• src/main/java/.../dtos → data‐transfer objects
• src/main/java/.../excepciones → custom exceptions
• src/main/resources/application.properties → config for DB, port, etc.
• ddl-schema.sql → initial database schema
• There is also a test package for unit/integration tests.
Main components & their interactions
a. External Client
• E.g., UI or another service calls REST endpoints (over HTTP).
b. API Layer (Controllers + Mappers)
• ProductoController receives HTTP requests.
• Calls Mapper classes (ProductoMapper, CategoriaMapper, etc.) to convert between Entity ↔ DTO.
c. Service Layer
• ProductoService enforces business rules, orchestrates calls to repositories and handles exceptions.
d. Persistence Layer
• Spring Data JPA Repositories (ProductoRepository, CategoriaRepository, …) perform CRUD on the relational database.
e. Database
• A relational DB (schema defined in ddl-schema.sql) stores entities: Producto, Categoria, Atributo, Relacion.
Architectural patterns & design principles
• Layered (Onion) Architecture: Controller → Service → Repository → Database
• DTO pattern: strong separation between internal entity model and API contract
• Dependency Injection (Spring) for loose coupling
• Exception Handling: custom exceptions bubble up to a global handler (not shown but implied)