advanced
Refactor Monolithic Code to Hexagonal Architecture
Analyze a legacy code snippet and restructure it into a hexagonal architecture pattern, identifying SOLID violations.
📝 Contenu du Prompt
Act as a Senior Software Architect. Analyze the following legacy code snippet [INSERT CODE]. Identify all code smells, violations of SOLID principles, and tightly coupled dependencies. Refactor this code into a Hexagonal (Ports and Adapters) Architecture. Provide the refactored code in the same language, explain the separation of concerns between the domain, application, and infrastructure layers, and define the interfaces for the ports.