How luishu533/coversordemonedas works
Project type and purpose
• This is a Java-based, console (CLI) application (“Conversor de Monedas”) whose sole responsibility is to read a user’s text input (“1000 dólares a soles”), parse it, call an external ExchangeRate API, and print the conversion result.
File structure
• Top-level:
• src/com/alura/coversorDeMonedas/principal
• src/lib/gson-2.13.1.jar
• Under “principal” you have:
• Principal.java (entry point / CLI loop)
• Bienvenida.java (welcome & help text)
• FraseConversor.java (parser for “<cantidad> <moneda1> a <moneda2>”)
• DatosMoneda.java (map of supported currencies & ISO codes)
• Moneda.java (currency model)
• ConsultaApi.java (HTTP client to ExchangeRate API)
• Conversor.java (data model for JSON response)
README for additional insights
• The README confirms:
• Java 17+, uses Gson for JSON
• Flow: read CLI → parse → fetch rates → compute → output
• External dependency: ExchangeRate-API
Essential architectural elements
• Don’t overcomplicate—break the system into the five layers above
• Classes and their relationships—each class as its own sub-component if needed
• External dependency (Gson JAR) and the remote API