Skip to main content
InterviewHubPRO
Section Overview
Q43

Question 43 of 50

Part 3: Enterprise Architecture, Package Design & Enforcement (25 - 35)

86%
SOLID & OOP Principles (50 Qs)•Part 3: Enterprise Architecture, Package Design & Enforcement (25 - 35)

Refactoring God Classes to SRP: Facades and Delegation.

senior LevelSystem Design

In Simple Words: Refactoring a 5,000-line monolithic UserManager class:

  1. Identify cohesive clusters of methods:
    • Auth & Passwords -> Extract to AuthenticationService.
    • Email Notifications -> Extract to UserEmailNotifier.
    • Profile Billing -> Extract to UserSubscriptionService.
  2. Convert the original UserManager into a lightweight Facade that delegates calls to the new specialized services.
  3. Migrate caller code over time to depend directly on the specialized services, and eventually retire the facade.