Skip to content

Rename App Commands to Command Handlers #22

@josecelano

Description

@josecelano

Rename App Commands to Command Handlers

Type: Task
Priority: High
Parent Epic: #10 - UI Layer Destroy Command
Estimated Effort: 2-3 hours


📋 Issue Overview

Refactor terminology to distinguish between UI commands (Clap) and Application Layer commands (DDD). This provides clear separation as we introduce UI-level commands.

🎯 Problem Statement

As we introduce UI-level commands (Clap subcommands), we need clear terminology to avoid confusion:

  • UI Command: Clap subcommand (e.g., destroy, provision)
  • Command Handler: DDD Application Layer command (e.g., DestroyCommand, ProvisionCommand)

Currently, both concepts are called "commands" which creates ambiguity.

🎯 Goals

Establish clear naming conventions that distinguish between:

  • UI Layer: Clap subcommands that handle user input
  • Application Layer: DDD command handlers that orchestrate business logic

📦 Scope

Files to Update

  • Rename structs/modules in src/application/commands/ for clarity
  • Update documentation to use "command handler" terminology
  • Ensure consistent naming across the codebase

Expected Renaming Pattern

// BEFORE (Current)
pub struct DestroyCommand { /* ... */ }
pub struct ProvisionCommand { /* ... */ }

// AFTER (Proposed) - Choose one approach:

// Option A: Add Handler suffix
pub struct DestroyCommandHandler { /* ... */ }
pub struct ProvisionCommandHandler { /* ... */ }

// Option B: Use Handler prefix
pub struct DestroyHandler { /* ... */ }
pub struct ProvisionHandler { /* ... */ }

Documentation Updates

Update all references in:

  • Code comments
  • Module documentation
  • Architecture documentation
  • Contributing guidelines

✅ Acceptance Criteria

  • Command handlers renamed consistently across the codebase
  • Documentation updated with new "command handler" terminology
  • No breaking changes to functionality
  • All tests pass after refactoring
  • Code follows project conventions
  • Clear distinction between UI commands (Clap) and command handlers (DDD)
  • Module exports updated to reflect new naming
  • Import statements updated throughout the codebase

Testing Requirements

  • All existing unit tests pass
  • All existing integration tests pass
  • All E2E tests pass
  • No functionality changes, only naming

🔍 Implementation Strategy

  1. Choose naming convention (Handler suffix vs Handler prefix)
  2. Update struct definitions in src/application/commands/
  3. Update module exports in mod.rs files
  4. Update imports throughout the codebase
  5. Update documentation and code comments
  6. Run full test suite to verify no breakage

🔗 Related Issues

📚 Related Documentation


Full specification: See docs/issues/rename-app-commands-to-command-handlers.md

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions