Skip to content

Domain Model

HarperCC101 edited this page Mar 30, 2025 · 2 revisions

Domain Model

Domain Model

  1. Budget Class: budget as a group of categories and transactions

    • Attributes:
      • categories: dictionary with category names (strings) as keys and Category objects as values
      • transactions: list of Transaction objects within this budget
  2. Category Class: category within a budget

    • Attributes:
      • name: category name (string)
      • spent: total amount spent in this category (double)
      • limit: spending limit for this category (double)
  3. Transaction Class: transaction within a budget

    • Attributes:
      • amount: transaction amount (double)
      • category: transaction category (Category object)
      • date: transaction date and time (DateTime object)

Explanation of Relationships:

  • 1 to * Relationship between Budget and Category:
    • A budget can have many ('*') categories, but each category can have only one ('1') budget
  • 1 to * Relationship between Category and Transaction:
    • A category can have many ('*') transactions, but each transaction can have only one ('1') category

Clone this wiki locally