🏗️ EJERCICIO 6 — JAVA-MARKET
Arquitectura Profesional en Java (Inventario + Ventas)
Rol activo: Arquitecto de Software Java.
Esto ya no es “hacer ejercicios”: es diseñar un sistema coherente, extensible y seguro.
🎯 Objetivo académico:
Que este proyecto pueda defenderse como Proyecto Final de 1º (Ingeniería / DAM
/ DAW) con nota alta.
🧩 ARQUITECTURA UML (ASCII)
┌──────────────────────┐
│Vendible (interface) │
├──────────────────────┤
│ + calcularPrecioVenta():double
│ + getID():String |
└──────────▲───────────┘
│ implements
┌──────────┴───────────┐
│ Producto (abstract)│
├──────────────────────┤
│ # id : String │
│ # nombre : String │
│ # precioBase : double│
├──────────────────────┤
│ + getID() │
│ + getNombre() │
│ + getPrecioBase() │
│ + calcularPrecioVenta() (abs)
└──────────▲───────────┘
│
┌─────────────┴─────────────┐
│ │
┌────────────────────┐ ┌────────────────────┐
, │ Electronica │ │ Alimentacion │
├────────────────────┤ ├────────────────────┤
│ + impuesto 20% │ │ -diasCaducidad:int │
├────────────────────┤ ├────────────────────┤
│ + calcularPrecio() │ │ + calcularPrecio() │
└────────────────────┘ └────────────────────┘
┌────────────────────────────────────┐
│ GestorInventario │
├────────────────────────────────────┤
│ - stock : HashMap<String,Producto> │
├────────────────────────────────────┤
│ + agregarProducto(p) │
│ + eliminarProducto(id) │
│ + venderProducto(id) throws Exc │
│ + listar() │
│ + cargarCSV() │
│ + guardarCSV() │
└────────────────────────────────────┘
🧠 DECISIONES DE ARQUITECTO
✅ ¿Por qué Interface Vendible ?
Porque separa qué se puede vender de cómo es el producto.
Mañana puedes vender:
servicios,
suscripciones,
packs…
sin tocar el sistema base.
👉 Es polimorfismo real de negocio.
Arquitectura Profesional en Java (Inventario + Ventas)
Rol activo: Arquitecto de Software Java.
Esto ya no es “hacer ejercicios”: es diseñar un sistema coherente, extensible y seguro.
🎯 Objetivo académico:
Que este proyecto pueda defenderse como Proyecto Final de 1º (Ingeniería / DAM
/ DAW) con nota alta.
🧩 ARQUITECTURA UML (ASCII)
┌──────────────────────┐
│Vendible (interface) │
├──────────────────────┤
│ + calcularPrecioVenta():double
│ + getID():String |
└──────────▲───────────┘
│ implements
┌──────────┴───────────┐
│ Producto (abstract)│
├──────────────────────┤
│ # id : String │
│ # nombre : String │
│ # precioBase : double│
├──────────────────────┤
│ + getID() │
│ + getNombre() │
│ + getPrecioBase() │
│ + calcularPrecioVenta() (abs)
└──────────▲───────────┘
│
┌─────────────┴─────────────┐
│ │
┌────────────────────┐ ┌────────────────────┐
, │ Electronica │ │ Alimentacion │
├────────────────────┤ ├────────────────────┤
│ + impuesto 20% │ │ -diasCaducidad:int │
├────────────────────┤ ├────────────────────┤
│ + calcularPrecio() │ │ + calcularPrecio() │
└────────────────────┘ └────────────────────┘
┌────────────────────────────────────┐
│ GestorInventario │
├────────────────────────────────────┤
│ - stock : HashMap<String,Producto> │
├────────────────────────────────────┤
│ + agregarProducto(p) │
│ + eliminarProducto(id) │
│ + venderProducto(id) throws Exc │
│ + listar() │
│ + cargarCSV() │
│ + guardarCSV() │
└────────────────────────────────────┘
🧠 DECISIONES DE ARQUITECTO
✅ ¿Por qué Interface Vendible ?
Porque separa qué se puede vender de cómo es el producto.
Mañana puedes vender:
servicios,
suscripciones,
packs…
sin tocar el sistema base.
👉 Es polimorfismo real de negocio.