Advanced
SOLID Principles Refactoring
Refactor a monolithic Python script into a clean architecture adhering to SOLID principles.
📝 Nội dung Prompt
Analyze the following legacy Python code snippet that handles user data processing, file I/O, and database updates all within a single function. Refactor this code into a modular, object-oriented structure that strictly adheres to the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion). Provide the refactored code with docstrings explaining which pattern is applied and where dependencies are injected.