Convert Onboarding::Status into a presenter construct
Currently, the Onboarding::Status
class may be handling both data management and presentation logic. To improve separation of concerns and adhere to the Single Responsibility Principle, we should convert Onboarding::Status
into a presenter construct.
Objectives
- Replace
Onboarding::Status
with a newOnboarding::StatusPresenter
class. -
Onboarding::UserStatus
and the Registration type classes remain focused on data management and business logic. - Update all relevant views and controllers to use the new presenter.
Expected Benefits
- Clearer separation of concerns between data management and presentation
- Improved testability of both the original
Onboarding::UserStatus
and the new presenter - Enhanced maintainability and readability of the codebase
- Easier to extend or modify presentation logic without affecting core data structures
Implementation Steps
- Create the
Onboarding::StatusPresenter
class. - Identify and move all presentation-related methods from
Onboarding::Status
toOnboarding::StatusPresenter
. - Update views and controllers to use the new presenter instead of calling presentation methods directly on
Onboarding::Status
. - Ensure all existing functionality is maintained through the presenter.
- Add unit tests for the new presenter class.
- Update existing tests to reflect the changes.
Acceptance Criteria
-
Onboarding::StatusPresenter
is created and contains all presentation logic. -
Onboarding::UserStatus
is refactored to focus solely on data management and business logic. - All views and controllers are updated to use the new presenter.
- Existing functionality remains unchanged.
-
New unit tests are added for
Onboarding::StatusPresenter
. - All existing tests pass after the refactoring.
Additional Considerations
- Ensure backwards compatibility if this change affects any public APIs.