advanced
Architectural Refactoring of Monolithic Code
Analyze a hypothetical legacy function, identify coupling issues, and rewrite it using the Dependency Injection pattern and SOLID principles.
📝 Contenu du Prompt
Analyze the following pseudo-code which describes a monolithic data processing function. Identify violations of SOLID principles, specifically regarding Single Responsibility and Dependency Inversion. Rewrite the code to decouple the data retrieval, processing, and logging logic using the Dependency Injection pattern. Explain your architectural choices and how they improve testability and maintainability.