Local Storage Implementation in BalanceViewModel Juan David Salguero - ISIS3510-MOBILE-T34/T34-Wiki-SpendiQ GitHub Wiki

We have updated the BalanceViewModel class to use local storage with Core Data. This replaces the dependency on Firebase, enabling more efficient and autonomous data management within the app.

Justification

We used Core Data because it integrates seamlessly with the iOS ecosystem, improving performance and reliability in data handling. As a native solution, it simplifies data storage, retrieval, and manipulation without relying on external services. The main goal is to optimize the app’s efficiency and autonomy in handling balance and transaction data. This improves the user experience, ensures data access at all times, and prepares the app for future enhancements and expansions.

Two main entities were implemented:

  • TransactionEntity: Stores transactions locally with attributes like amount, dateTime, and transactionType.
  • BalanceDataEntity: Caches pre-calculated balance data with attributes date and balance. This avoids recalculating the balance repeatedly, enhancing speed and efficiency.

Benefits of the Implementation

  • Performance improvement: Caching balance data allows the app to load and display information more quickly.
  • Offline functionality: Local data storage ensures the app works without an internet connection.
  • Reduced external dependencies: Removing Firebase simplifies the architecture and minimizes potential points of failure.
  • Ease of maintenance: Core Data streamlines development and supports future scalability as part of Apple’s ecosystem.